Dear All,
We have created our control (say MyControl) derived from
System.Windows.Forms.Control. MyControl contains 3 buttons in it.
At design time, when programmer drag-drops 'MyControl' from toolbox on
his form,
MyControl gets added on that Form with 3 buttons added in the MyControl.
How application programmer can change the properties of these buttons at
design time?
(Should I have to add some attribute in MyControl ....)
Please guide me.
Thanx & Regards
Jack
lukasz - 13 Sep 2004 14:39 GMT
The simplest way would be publishing some properties that change your
button. E.g. if you want to allow changing text of button2, add:
[Browsable(true), Category("MyControl")]
public string TextButton2 {
get { return button2.Text; }
set { button2.Text = value; }
}
The more difficult way would be writing own custom designer that allows
selecing the buttons within your control, adding a verb (menu item for
context menu for the control), or custom type in property grid that will
open a window with convenient editor for the buttons' properties.
> Dear All,
> We have created our control (say MyControl) derived from
[quoted text clipped - 11 lines]
> Thanx & Regards
> Jack