How can I hide the resizing handles of a control in Windows Forms?
I have an UserControl and would like to hide the resiz开发者_JAVA百科ing 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.
精彩评论