Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I hide the resizing handles of a control in Windows Forms?

I have an UserControl and would like to hide the resizing handles in design-time, just like the TextBoxControl, that has only two handles (left and right ones)... the height of the textbox is fixed, unless you say it is multiline. In that case, the textbox shows all nine resizing handles.

like image 462
Miguel Angelo Avatar asked Mar 22 '10 18:03

Miguel Angelo


People also ask

How do you disable resize in Windows form?

First, select the form. Then, go to the properties menu. And change the property "FormBorderStyle" from sizable to Fixed3D or FixedSingle.

Is it possible to resize a control within the form design window?

To resize multiple controls on a form In Visual Studio, hold down the Ctrl or Shift key and select the controls you want to resize. The size of the first control you select is used for the other controls.

What is used to move and resize the controls on the form window?

By default, the controls on an Access form stay anchored to the upper-left corner of the form, and do not resize when you resize the form. To change this behavior, you can use the Anchoring command.

Which property of a control is used to make it automatically resize based on a resizing of its parent?

The Anchor Property determines how a control is automatically resized when its parent control is resized.


1 Answers

You need to implement a custom designer (ControlDesigner) for your control and then override the SelectionRules property.

Useful reference:

Extending Design-Time Support

like image 181
João Angelo Avatar answered Sep 17 '22 16:09

João Angelo