C# Toolstrip 导致支持表单增长

发布于 2024-11-27 22:07:18 字数 327 浏览 2 评论 0原文

我重写了位于用户屏幕顶部的工具栏。它可以工作,但由于某种原因,尽管该应用程序仅包含一个带有填充停靠工具条的表单,但我无法让它保持我指定的大小。它应该是 Windows 标题栏的大小,正如在 Visual Studio 中设计的那样,但是当我运行它时,它的高度就增加了五到六个像素。一切都被严格设置,Form 和 ToolStrip 设置为 AutoSize=FALSE,并且我已经指定了表单应有的大小(以像素为单位)。我无法弄清楚是什么在运行时调整表单的大小; ToolStrip 在填充模式下停靠,因此它不会导致表单变大。这一切在 GUI 构建器中看起来都很完美,我从它将替换的旧 VB.Net 工具栏中复制了大部分配置。有人可以帮忙吗?

I've rewritten a toolbar that sits at the top of the user's screen. It works, but for some reason, though the app consists of just a form with a Fill-Docked ToolStrip, I cannot get it to stay at the size I specify. It's supposed to be the size of the Windows titlebar, as designed in Visual Studio, but as soon as I run it, it's grown in height by five or six pixels. Everything is set rigidly, the Form and ToolStrip are set to AutoSize=FALSE and I've specified the size in pixels the form should be. I cannot work out what is resizing the form at runtime; the ToolStrip is Docked on Fill mode so it should not cause the form to grow. It all looks perfect in the GUI builder, and I copied most of the configuration from the old VB.Net toolbar it will replace. Can anyone help?

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

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

发布评论

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

评论(2

撕心裂肺的伤痛 2024-12-04 22:07:18

只是一个疯狂的猜测,但是您是否尝试过将 FormAutoScaleMode 属性更改为 Font 以外的其他属性?

Just a wild guess, but have you tried changing the AutoScaleMode property of the Form to something other than Font?

无畏 2024-12-04 22:07:18

还没有找到答案,但我会确保它已关闭。我将表格变成透明的,它完成了我所需要的。仍然不确定为什么表单在运行时会扩展。

Haven't found an answer but I'll make sure this is closed. I turned the form transparent and it accomplished what I needed. Still unsure why the form expanded when run.

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