简体   繁体   中英

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.

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

Useful reference:

Extending Design-Time Support

I think you would need to draw your own control and define the size in the class. I believe if you inherit a user control you'll always have the option to resize.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM