all groups > dotnet windows forms designtime > september 2004 >
You're in the

dotnet windows forms designtime

group:

Design time support for the Control


Design time support for the Control Jack Wright
9/13/2004 4:44:45 AM
dotnet windows forms designtime: 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

*** Sent via Developersdex http://www.developersdex.com ***
Re: Design time support for the Control lukasz
9/13/2004 3:39:10 PM
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.


Uzytkownik "Jack Wright" <sunil@volcanomail.com> napisal w wiadomosci
news:OVU4RcYmEHA.2764@TK2MSFTNGP11.phx.gbl...
[quoted text, click to view]

AddThis Social Bookmark Button