Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Windows Forms / Design Time / September 2004

Tip: Looking for answers? Try searching our database.

Design time support for the Control

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Jack Wright - 13 Sep 2004 12:44 GMT
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

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.