Monday, June 05, 2006

Label Provider for WinForms

HotDog’s Blog - LabelProvider

"For the description of most controls we use labels and I for one don’t like to add a label manually for each control. Been using a component that paints values, but never got around to put it in a nice coat and with design time support up until now. The design time being the most work (although greatly alleviated by finding out how to use the isComplete parameter of the InstanceDescriptor ;-) ), the component is easy in use and deployment.

Usage: drop it to your form (or container control) and you get a new property on each control (”Label on LabelProviderName”).

You can simply type in the labeltext and a label will be painted on its parent.

To set more details, when the text is set a LabelInfo object will be created automatically. A plus sign appears in front of the property once it has been set, to indicate it can be expanded. Other properties for the label such as the Alignment, Font and Color can then be set. ..."
 
That’s pretty darn cool...

The "label my controls game" is one that I don’t like playing when building WinForm apps. The LabelProvider sounds like a great idea and one that could save a good bit of time.

No comments: