I'm getting ready to bust out a series of articles on Hosting the Visual Studio Designer Surface. Controls, Designers for Controls, drag 'n drop life, ISite, and the myriad jungle of nonsense needed to make the Property Grid do just what you want it to.
One complaint you'll hear over and over again is this: surely there must be a better way to create my controls' contract with their designer than Class and Property level attributes?
/// <summary>
/// Show a dotted line warning the sticker margin vs. the page margin
/// </summary>
[Browsable(true)]
[Description("Vertical margin size in fractions of an inch")]
[EditorBrowsable(EditorBrowsableState.Always)]
[DefaultValue(.25f)]
[DisplayName("V. Margin")]
public float VerticalStickerMargin
{
get { return _verticalMargin; }
set
{
_verticalMargin = value;
Invalidate();
}
}
Next up, some designer classes.