Click here to Skip to main content
15,898,862 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I would like to add these controls to my project can anyone help me with the steps; step by step to add these controls to my project and use them normally like any controller?

C# Avionic Instrument Controls[^]
Posted
Updated 18-Apr-13 15:59pm
v2
Comments
Sergey Alexandrovich Kryukov 18-Apr-13 22:37pm    
What did you try? Was it hard to get required information from the article? Could you read MSDN documentation on UI development and control? Did you try to understand it? What was the difficulty? How much and time and did you put in it?
—SA
Haytham.Breaka 18-Apr-13 23:02pm    
@Sergey I tried alot in this and I know how to add controller I always use add user control to add my own or add existing item if it exist. But in this case when I tried this idea I had many Errors and when I read the comments of the article I didn't get how to add these controls in my project I tried to add the resources and the code of each control but I have nothing more than errors. I also asked the writer today but I asked here too just in case that the article author didn't check his mail. I'm sorry that I didn't show that I have tried to do it my self in my question but I read the rules of asking a question that "Be Brief....Be specific"

1 solution

All controls are always added this way:

C#
class SomeControl : System.Windows.Forms.Control { // some C# Avionic Instrument Control; or any other control
    // ...
}

//...

Panel parentControl = new Panel(); // can be Form, some other control which can be a parent
SomeControl myControl = new SomeControl();
SomeControl someOtherControl = new SomeControl(); 
// set up properties, alignment and other

//...

parentControl.Controls.Add(myControl);
// alternative way, with the same effect:
someOtherControl.Parent = parentControl;


Well, the assembly (or assemblies) should be compiled and referenced. The best way of doing so it to put all source code under the same Visual Studio solution. In this case, the reference can be added by referencing the project, via the tab "Projects" of the "Add Reference" window. The reference itself is always between compiled assemblies, but in this case, it is done automatically, modifications in the project in dependencies are taken account automatically, and the dependencies between projects are detected automatically, based on those references.

For everything else, ask the author of the article, if needed. Locate the section "Comments and Discussions", hit "Add a Comment or Question" and add your questions. The author will get a notification and a chance to answer you.

However, I have a strong impression that you are going in a wrong way. The question reveals that you don't have understanding of basic development/support cycle. This is perfectly fine, it will come with time. First of all, you need to learn it all and try to develop something very simple, to get basic understanding and confidence. Instead, you want to get something "cool", fast. Well, you can, but don't forget: you should not skip those more important steps when you do everything from scratch, with full understanding of each step, based on first principles, without asking for a cookbook step-by-step recipe.

Good luck,
—SA
 
Share this answer
 
v2
Comments
Haytham.Breaka 18-Apr-13 23:19pm    
thnx for your advice...can you provide me with tutorial links? to help me get the first principles? :)
Sergey Alexandrovich Kryukov 19-Apr-13 0:22am    
Good idea. Now, tutorial on what? On adding controls I already explained you everything, and of course you need to read help pages in Form, Control, and every control you are going to use.

You see, I don't know your background, and I personally never needed tutorial on the .NET topics as I knew big part of the matter before .NET was created, so for me MSDN is quite enough, but it is actually quite enough for anyone, it's just the matter of convenience and time spent. I don't know if you know OOP, references, assemblies, namespaces and so on. I don't know which programming technique do you know. I don't even know if you understand variables, members (static and instance), method, parameters and method of passing them.

You can take any textbook on C# and .NET, read it from first page and try to do exercises.

Certainly, you can use this:
http://csharp.net-informations.com
http://en.csharp-online.net/CSharp_Language_Specification
http://msdn.microsoft.com/en-us/library/67ef8sbd.aspx

Good luck,
<dd>—SA</dd>

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900