为什么我的水平工具条一直垂直堆叠?

发布于 2024-09-05 20:24:22 字数 343 浏览 1 评论 0原文

我正在使用包含三个 ToolStrip 的 ToolStripContainer。在设计时,我将 ToolStrip 移动到我想要的位置,该位置位于表单顶部的水平行中,如下所示:

alt text

然后我关闭并保存表单。但是,如果我再次打开表单,ToolStrip 最终会堆叠在 ToolStripContainer 的左侧,如下所示:

alt text

如何将 ToolStrip 保留在我指定的位置?

I'm using a ToolStripContainer that contains three ToolStrips. At design time I move the ToolStrips to the positions I want them in, which is in a horizontal row across the top of the form like this:

alt text

I then close and save the Form. However, if I open the form up again the ToolStrips end up stacked up on the left side of the ToolStripContainer like this:

alt text

How can I keep the ToolStrips in the positions that I specify?

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

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

发布评论

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

评论(1

明月夜 2024-09-12 20:24:22

这是 Visual Studio 的一个错误。
多年来我一直遇到同样的问题。
我发现的唯一方法是以编程方式将所有 ToolStrips 的 Dock 属性设置为 Right
在调用 InitializeComponent 之后,在表单的构造函数中执行此操作。

This is a bug with Visual Studio.
I've had the same issues for years.
The only way I've found is to programmatically set all the ToolStrips' Dock property to Right.
Do this in the Form's constructor, just after the call to InitializeComponent.

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