如何隐藏在Windows窗体控件的大小调整控?窗体、控件、大小、Windows

2023-09-03 01:15:15 作者:萌萌的兔耳朵

我有一个用户控件,并想隐藏在设计时调整大小处理,就像TextBoxControl,那只有两个手柄(左和右的)...文本框的高度是固定的,除非你说这是多行。在这种情况下,文本框显示所有九个调整大小手柄。

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.

推荐答案

您需要实现自定义设计(ControlDesigner)为您的控件,然后重写 SelectionRules 属性。

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

有用的参考:

扩展设计时支持

 
精彩推荐
图片推荐