如何隐藏在Windows窗体控件的大小调整控? [英] How can I hide the resizing handles of a control in Windows Forms?

查看:127
本文介绍了如何隐藏在Windows窗体控件的大小调整控?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个用户控件,并想隐藏在设计时调整大小处理,就像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.

推荐答案

您需要实现自定义设计(<一href="http://msdn.microsoft.com/en-us/library/system.windows.forms.design.controldesigner.aspx">ControlDesigner)为您的控件,然后重写 SelectionRules 属性。

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

有用的参考:

扩展设计时支持

这篇关于如何隐藏在Windows窗体控件的大小调整控?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆