开发者

How to create Asp.net c# Custom control with properties select from a dropdownlist?

开发者 https://www.devze.com 2023-02-12 00:07 出处:网络
How to create Asp.net c# Custom control with properties select from a dropdownlist? Example: I try to create my own TextBox inherit from TextBox.

How to create Asp.net c# Custom control with properties select from a dropdownlist?

Example: I try to create my own TextBox inherit from TextBox. It has a property named "MyOwnColor". When add custom control to Visual Studio, in the properties windo开发者_如何学Cw, property "MyOwnColor" can input by type Text to input field. So, what can i replace input field with a dropdownlist that has some selection are set by me?

Image: http://i.stack.imgur.com/7UaLV.jpg I want to create properties like Border Style. I have read some sucguest about "TypeConverter" but i don't know how to use ...

Can you help me?

I am bad at English. Thanks...


I've asked on some forum and answer is: Use an enum.

public enum Color
        {
            Red,
            Blue,
            Green
        }
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号