Usually, when you select a control in a designer, it will show dimensional markers (small squares of a white square) around it . I want to make my control unrealizable , and I partially implemented it by setting the size to OnPaint , but the markers are still visible and you can still drag them (but the control returns to its previous size).
How to hide markers (e.g. shortcut with autosave enabled)?
(I override the AutoSize property)
[BrowsableAttribute(true)]
public override bool AutoSize {
get
{
return autosize;
}
set
{
autosize = value;
this.Invalidate();
}
}
source
share