You normally need this support when your Control is parented by another custom Container Control that manages the location and size of your Control.
You can prevent resizing by overriding this method in your custom ControlDesigner class:
protected override bool EnableDragRect
{
get { return false; }
}
Or, for more control over the resizing process:
public override /*ControlDesigner*/ SelectionRules SelectionRules
{
get
{
System.Windows.Forms.Design.SelectionRules selectionRules;
System.Windows.Forms.Control control;
selectionRules = base.SelectionRules;
control = this.Control;
if (control.Parent is MyControlParent)
selectionRules = (SelectionRules)(selectionRules & ~(SelectionRules.AllSizeable));
return selectionRules;
}
}
Share with