Visual Studio winForms 错误
当我在 Visual Studio (2008) 中编写程序时,它们在我的计算机上完美运行:程序对象的放置方式与我在设计器中的放置方式相同。但是当我在其他计算机上运行程序时,某些对象的位置错误了几个像素:它们接触了其他对象。我想这是由于我的显示器分辨率(1680x1050)造成的。我发现我可以使用TableLayoutPanel。还有其他想法可以解决我的问题吗?谢谢。
When i write my programs in Visual Studio (2008), they run perfeclty at my computer: program's objects are placed as i did it in designer. But when i run programs on other computers, some objects are placed wrong by few pixels: they touch other object. I suppose it is due to my monitor's resolution (1680x1050). I find that I can use TableLayoutPanel. Any other ideas to solve my problem? Thank you.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
为什么不将应用程序窗口的大小设置为所需的分辨率并查看其呈现方式。这应该呈现 GUI,就像应用程序在这些分辨率下运行一样。
您可以检查的另一件事是如何定义 TableLayoutPanel 上的列/行的大小。您可以将它们的大小设置为相对或绝对大小。如果将其设置为绝对大小,则对象应始终出现在同一位置。
Why don't you set the size of your application's window to a desire resolution and see how it is rendered. This should render the GUI as if the application was running in those resolutions.
Another thing you may check is for how the size of the columns/rows on TableLayoutPanel are defined. You can set their size as a relative or absolute size. If you set it to an absolute size the objects should appear always on the same place.
我建议您编写一个测试应用程序,使用尽可能少的控件来重现问题。
然后,回到这里并准确描述您在什么情况下
请发布一些代码或屏幕截图。
I suggest you write a test application with as few controls possible where you can reproduce the issue.
Then, come back here to SO and describe exactly what situation you have
Please post some code or screenshots.