Windows Develop Bookmark and Share   
 index > Windows Forms Designer > DropDown - easy newbie
 

DropDown - easy newbie

Hello all,

Can someone please tell me how I can implement a simple design time dropdown for a property of my control. I can not seem to find any examples of this. I need to place two possible values in a dropdown. I can get my property to show, but is just has an editable textbox.

Thanks for any help,
Troy
MigrationUser 1  Monday, April 19, 2004 2:55 PM
Within your Control class, define an Enum.  Then declare your property to be of the Enum type you just defined.  This will give you a drop-down list in the designer.


Public Class MyControl

     Public Enum MyPropValues
          FirstValue
          SecondValue
     End Enum

     Public Property MyProperty As MyPropValues
          .
          .
          .
     End Property

End Class


Tony
MigrationUser 1  Tuesday, April 20, 2004 7:26 AM
Nevermind, I found it boys and girls. Just was not looking in the right places.

Thanks anyway,
Troy
MigrationUser 1  Tuesday, April 20, 2004 9:31 AM
thanks Tony, much appreciated. Your example was a lot clearer then the one I found.

thanks again,
Troy
MigrationUser 1  Wednesday, April 21, 2004 10:25 AM

You can use google to search for other answers

Custom Search

More Threads

• SmartTags on root component?
• Clone Copy a Panel with its controls
• Container Control
• Capture Enter key
• Prefilterproperties not working with the subproperty
• how to redraw titlebar and borderframe
• Creating transaction for undoEngine?
• Holding TreeNode Postion
• Asynchronus Threading Issue (Does not make sense to me)
• XML Mapper