如何隐藏 Windows 窗体中控件的大小调整手柄?

发布于 2024-08-26 07:13:32 字数 123 浏览 6 评论 0原文

我有一个 UserControl,想在设计时隐藏调整大小手柄,就像 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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

ˇ宁静的妩媚 2024-09-02 07:13:32

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

Useful reference:

Extending Design-Time Support

二智少女猫性小仙女 2024-09-02 07:13:32

我认为您需要绘制自己的控件并在类中定义大小。我相信如果您继承了用户控件,您将始终可以选择调整大小。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文