C# Toolstrip 导致支持表单增长
我重写了位于用户屏幕顶部的工具栏。它可以工作,但由于某种原因,尽管该应用程序仅包含一个带有填充停靠工具条的表单,但我无法让它保持我指定的大小。它应该是 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
只是一个疯狂的猜测,但是您是否尝试过将 Form 的 AutoScaleMode 属性更改为 Font 以外的其他属性?
Just a wild guess, but have you tried changing the AutoScaleMode property of the Form to something other than Font?
还没有找到答案,但我会确保它已关闭。我将表格变成透明的,它完成了我所需要的。仍然不确定为什么表单在运行时会扩展。
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.