This code bank submission is aimed more so at people that either want to learn how to create a design editor for Enums, or people that like doing custom drawing.
Often times when you're creating a custom control, such as a custom button you will add a property called BorderColor or something to that effect. This code is so you can add a property called BorderStyles where you can select which borders to draw. Of course this could be used for whatever you like. This was coded with 3.5 framework, and as such it uses a little LINQ and initializer syntax, although 99% of the code is compatible with 2.0, you will just have to change a couple things.
Here are some screen shots of what the code does:
Screen shot of the Properties editor in VS where I have a custom control that has a property called "BorderStyle".
Screen shot of what happens when you edit the BorderStyle by clicking the drop down:
Attached is the code.
If something is not working for you, please review this question list before asking:
1) Did you add all the right references?
2) Did you add this file via Project > Add Existing Item?
3) Did you qualify the editor name like it says above the Enum in the comments?




Reply With Quote
