I want to create a custom control by extending an existing control. In fact, I want to add some features to the original control. How can I another control (a control such as TextBox) to my custom control in its constructor or anywhere else?
public partial class AdvancedKnob : KnobControl
{
private DoubleInput Field_ValueControl = null;
public AdvancedKnob()
{
this.InitializeComponent();
this.Field_ValueControl = new DoubleInput();
this.Container.Add(this.Field_ValueControl); //DOES NOT WORK!!
}
}
Try this:
For more information, go to: How to programmatically add controls to Windows forms at run time by using Visual C#