System.Windows.Forms.ToolStrip 高度或自动调整大小

发布于 2024-07-08 03:06:41 字数 557 浏览 6 评论 0原文

我在 Excel 2007 操作窗格中使用一系列 ToolStrip。 我以编程方式向每个 ToolStrip 添加按钮,然后将每个 ToolStrip 添加到操作窗格。 到目前为止,一切都很好; 我的 ToolStrip 及其关联的 ToolStripButton 出现。

问题在于显示 ToolStrip 的全部内容。 我将 ToolStrip.AutoSize 设置为 true (实际上是默认值)。 该属性的描述如下:

“获取或设置一个值,指示 是否自动控制 调整大小以显示整个 内容。”

是,即使将其设置为 true,我的 ToolStrip 也会显示操作窗格的宽度,但只有一行高;对于那些包含更多按钮的 ToolStrip,然后可以在该空间中显示,ToolStrip 不会垂直扩展至显示整组按钮,而是显示右侧的下拉箭头,使用户可以看到其余的按钮,

那么我的问题是我是否误解了此属性(或者实际上是此属性)的用法。例如,AutoSize 是否仅与水平空间相关?无论它的价值如何,我也尝试过设置高度值但无济于事。

I'm using a series of ToolStrips in an Excel 2007 Actions Pane. I'm programatically adding buttons to each ToolStrip and then adding each ToolStrip to the actions pane. So far so good; my ToolStrips appear, with their associated ToolStripButtons.

The problem comes with displaying the entire contents of the ToolStrip. I have ToolStrip.AutoSize set to true (which is in fact the default). The description for that Property is as follows:

"Gets or sets a value indicating
whether the control is automatically
resized to display its entire
contents."

The problem is that even when it's set to true my ToolStrips show the width of the action pane but only one row high; for those ToolStrips that contain more buttons then can be displayed in that space the ToolStrip doesn't expand vertically to show the whole set of buttons, but instead shows the drop-down arrow on the right-side that allows the user to see the remaining buttons.

My question, then, is am I misinterpreting the usage of this property (or indeed, of this component)? Does the AutoSize only relate to horizontal space, for instance? For whatever it's worth, I've also tried setting the height value to no avail.

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

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

发布评论

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

评论(1

清秋悲枫 2024-07-15 03:06:41

将“LayoutStyle”属性设置为“Flow”值。 然后项目就会流到下一行。

Set "LayoutStyle" property to "Flow" value. Then will items flowed to the next line.

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