How can I add a combobox in control designer properties for a WinForms custom control?

The simple way to do that is to add an enum to your code that defines the possible choices for your property, then configure your custom control's property to accept a value of that type The Properties Window will automatically display a combo box for this property with all of the possible values in your enum listed.

The simple way to do that is to add an enum to your code that defines the possible choices for your property, then configure your custom control's property to accept a value of that type. The Properties Window will automatically display a combo box for this property with all of the possible values in your enum listed. So, for example: public enum Gender { Man, Woman, } public class MyCustomControl : UserControl { public Gender UserGender { get; set; } }.

That works great thanks! – user310291 Dec 2 '10 at 14:33.

As far as I remember, you should create an enum like: enum Person { Man, Woman } and then make your property of type Person. It should appear in properties as a drop down list.

Thanks you are both right. – user310291 Dec 2 '10 at 14:34.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions