仅显示 ToolStripMenuItem 图标

发布于 2024-08-07 08:07:23 字数 183 浏览 4 评论 0原文

我有一个 Windows 窗体 ToolStripSplitButton,它仅显示一个图标。我添加了一些 ToolStripMenuItems 并将其 DisplayStyle 设置为 ToolStripItemDisplayStyle.Image。下拉列表显示文本区域(但它是空白的),以及空白文本区域左侧的图像。有没有办法去掉文本区域,只显示图标?

I have a Windows Forms ToolStripSplitButton which shows only an icon. I have added some ToolStripMenuItems and I have set their DisplayStyle to ToolStripItemDisplayStyle.Image. The drop down display the area for text (but it's blank), and the image to the left of the empty text area. Is there a way to get rid of the text area so it only displays the icon?

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

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

发布评论

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

评论(1

帅的被狗咬 2024-08-14 08:07:23

在 ToolStripSplitButton 的 DropDown 上设置这些属性:

toolStripSplitButton1.DropDown.AutoSize = false;
toolStripSplitButton1.DropDown.Width = 27; // Or whatever size your icon width is.

Set these properties on the DropDown of the ToolStripSplitButton:

toolStripSplitButton1.DropDown.AutoSize = false;
toolStripSplitButton1.DropDown.Width = 27; // Or whatever size your icon width is.
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文