锁定 ToolStripContainer 面板以仅允许一行工具条

发布于 2024-08-04 18:29:05 字数 300 浏览 2 评论 0原文

我希望 ToolStrip 保留在一行上,并且用户能够在该行上重新排列,但不能创建其他行。我尝试在 LocationChanged 事件上使用 SetBounds,如果用户尝试更改 Y 位置,它就会立即弹回来。然而,这产生了一些视觉错误,例如鼠标总是跳回该位置以及 ToolStrip 随机跳跃(拖动其中一个时,另一个会在栏上随机跳跃......)

我还尝试设置 ToolStrip 的 MaximumSize toolstripcontainer 面板,但它允许创建一个新行(其中隐藏了工具条)。

编辑:已经几个月了,仍然没有答案......这可能吗?

I want the ToolStrips to remain on one row, and for the user to be able to rearrange on that row but not create additional rows. I tried using SetBounds on the LocationChanged event, if the user attempted to change the Y position it just sprung right back. However, this created some visual bugs, such as the mouse always jumping back to the location and the ToolStrips jumping around randomly (while dragging one, the other would hop around randomly on the bar...)

I also tried setting the MaximumSize of the toolstripcontainer panel, but it allowed the creation of a new row anyway (in which the toolstrips were hidden.)

EDIT: Its been a few months, still no answers...is this even possible?

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

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

发布评论

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

评论(1

夕嗳→ 2024-08-11 18:29:05

我有同样的问题。你明白了吗?您可能想看看 这篇文章。我认为它回答了您的问题,但我只是感到惊讶的是,人们必须编写一个自定义布局类来执行我认为 ToolStrip 的默认行为。

I have the same question. Did you figure this out? You might want to take a look at this post. I think it answers your question but I'm just surprised one would have to write a custom layout class to do what I would think would be default behavior for a ToolStrip.

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