Monday, September 01, 2008

Putting the final, professional touches on your UserControl - “How to use UITypeEditors, Smart Tags, ControlDesigner Verbs, and Expandable Properties to make Design Time editing easier.”

CodeProject - Rich Design Time Editing with UITypeEditors (VB.NET) 

“Introduction

This article assumes you have basic knowledge on creating a simple UserControl, so I am not going to go into much detail on creating one here. To demonstrate the Property Editors I desided to make a control that draws itself in a selected shape. This gave me lots of options to demonstrate different design time editors. This Demo uses UITypeEditors, Smart Tags, ControlDesigner Verbs, and Expandable Properties.

ShapeTypeEditor

Another example of the DropDown is the RadiusInnerTypeEditor. It uses the DropdownRadiusInner UserControl, which contains a TrackBar and a Shape Control. If the Shape is a Star sliding the TrackBar back and forth changes the RadiusInner property value on the star shape. When you get it the way you want, Check the Apply button to call CloseDropDown

RadiusInnerTypeEditor

 

The last Dropdown is the BlendTypeEditor. It uses the DropdownColorBlender UserControl, which is a slight variation on my ColorBlender UserControl[^] The UserControl may be more complex but there is very little difference in the EditValue Method.

BlendTypeEditor

…”

This is a great article/project on adding professional finish to a UserControl via rich design time editing features. Having all these things, UITypeEditors, Verbs, etc, in a single article is very nice. I thought the article was well written, with a good mix of images, copy and code snips.

If you’re doing UserControls and have been hesitant to provide rich propertygrid UI Type Editors because they seemed  “hard”, then take a look at this…

No comments: