C# 应用程序 GUI 在不同的 Windows 图标/文本大小设置上中断
https://i.sstatic.net/omaRV.png
我有 ac# 表单应用程序具有固定大小(无法调整大小)且无法最大化。对图标/文本大小有不同设置的用户会破坏我的 GUI(整个表单更大,背景图像开始平铺等。
有帮助吗?
https://i.sstatic.net/omaRV.png
I have a c# form application that has a fixed size (cannot be resized) and cannot be maximized. Users who have a different setting for their icon/text sizes breaks my GUI (the entire form is bigger, background images start tiling, etc.
Help?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
Microsoft 建议用户更改其 DPI(每英寸点数)设置并保持其原始分辨率,而不是更改分辨率以放大可见显示。本文还链接到构建 DPI 感知应用程序的指南。
http://msdn.microsoft.com/en-us /library/dd371771(VS.85).aspx
您应该允许您的表单和控件缩放,用户很可能出于某种原因更改了其 DPI 设置。这个原因很可能与可访问性有关,作为开发人员,我们应该努力遵守用户界面和可访问性标准。
这通常会增加为网站和应用程序创建资产的工作量。此外,还应考虑控件的定位,以确保它们在缩放时不会重叠或脱离窗体边缘。确保您的应用程序合规的最佳方法是在频谱的两端和正常推荐的使用设置上进行测试。
至于禁用表单最大化,只有当您可以确保表单能够毫无问题地适合最小的显示器时,才应执行此操作。我在带有 7 英寸屏幕的上网本上使用过应用程序,这些应用程序无法最大化,而且它们根本不适合,移动表单以访问某些控件的空间有限。如果可以最大化这些应用程序,我会期望所有控件可见,或者能够滚动到达它们
为所有人开发一个解决方案是一个挑战,但如果您的应用程序正常工作,您的最终用户将欣赏您所做的工作。我们应该努力提供满足所有用户需求的界面。
Microsoft recommends that a user change their DPI (dots per inch) settings and keep their native resolution rather than change the resolution to enlarge the visible display. This article also links to guides for building DPI aware applications.
http://msdn.microsoft.com/en-us/library/dd371771(VS.85).aspx
You should allow your forms and controls to scale, the user would most probably have changed their DPI settings for a reason. This reason is most probably related to accessibility and, as developers, we should strive to adhere to user interface and accessibility standards.
This usually increases the amount of work to create assets for web sites and applications. Also, thought should be put into the positioning of controls to ensure that they will not overlap or fall off the edge of the form when scaled. The best way to ensure that your application is compliant is to test at both ends of the spectrum and the normal recommended settings for usage.
As for disabling maximising of the form, this should only be done if you can ensure that the form will fit on the smallest of displays without issue. I have used applications on a netbook with a 7" screen that cannot be maximised, and they just don't fit, there is limited space to move the form around to access certain controls. If these could be maximised, I would then expect all controls to be visible, or can be able to scroll to reach them.
It is a challenge to develop a solution for all, but your end users will appreciate the work you have put in, if your application works correctly. Accessibility is a sensitive area and we should be making the effort to provide interfaces to cater for all users.
好吧,听起来你应该允许它调整大小......
坦率地说,即使是 MS 也得到了提示并开始更改其大部分表单甚至对话框以调整大小。这是友好的事情。
更新:
关于如何解决这个问题,我想到了一些事情。首先,将背景图像设置为拉伸。对于按钮,不使用图像来显示文本,而是使用具有一定透明度的背景图像并使用常规字体。
Well, sounds like you should allow it to be resized...
Quite frankly, even MS has gotten the hint and started changing most of their forms and even dialogs to be resizable. It's the friendly thing to do.
UPDATE:
A couple things come to mind on how to fix this. First, set the background image to Stretch. For the button, instead of using an image to display the text, just use a background image that has some transparency and use a regular font.
你应该多描述一下你想要的东西。由于我不确定您实际想要发生什么,因此您可以通过将表单属性
AutoScaleMode
更改为 None 来防止表单元素调整大小。You should be a little more description of what you want. Since I'm not sure what you want to actually happen, you can prevent the form elements from resizing by changing your forms property
AutoScaleMode
to None.