开发者

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜