Vista 中固定表单边框样式的奇怪问题
我之前关于这个问题的文章没有得到太多答案,而且有点具体且难以理解。 我想我已经更好地理解了这个问题,现在我相信这是一个 Vista 问题...
问题在于所有类型的固定边框样式,如 FixDialog、Fixed3D、FixedSingle 和 FixToolWindow。 它不会发生在体型较大的人身上。 这个问题,就像我说的,也只发生在 Vista 上。
假设您有一个具有任何固定边框样式的表单,并将起始位置设置为 0,0。 您想要的是将表单捕捉到屏幕的左上角。 如果表单边框样式是相当大的选项之一,则效果很好,如果它是固定的,那么表单将在屏幕工作区域的左侧和顶部之外一点。
更奇怪的是,表单位置没有改变,仍然是 0,0,但是表单的几个像素仍然绘制在工作屏幕区域之外。
我在 XP 上测试了这个问题,但没有发生,问题是 Vista 特有的。 在 XP 上,唯一的区别是边框大小在任何样式之间略有变化。 但窗体总是完美地捕捉到位置 0,0。
如果可能,无需查找在工作区域之外绘制了多少像素,然后将其添加到表单位置,是否有可能的方法来修复或解决此问题?
My previous post about this issue didn't got too many answers and it was kinda specific and hard to understand. I think I've managed to understand the problem better and I now believe it to be a Vista issue...
The problem lies on all types of fixed border styles like FixedDialog, Fixed3D, FixedSingle and FixedToolWindow. It does not happen on the sizable ones. This problem, like I said, it also happens only on Vista.
Let's say you have a form with any of the fixed border styles and set the starting location to 0,0. What you want here is for the form to be snapped to the top left corner of the screen. This works just fine if the form border style is one of the sizable options, if it's fixed, well, the form will be a little bit outside of the screen working area both to the left and top.
What's more strange about this is that the form location does not change, it sill is 0,0, but a few pixels of the form are still drawn outside of the working screen area.
I tested this on XP and it didn't happen, the problem is Vista specific. On XP, the only difference was the border size that change a bit between any of the styles. But the form was always perfectly snapped to position 0,0.
If possible, without finding how many pixels are being drawn outside of the working area and then add that to the form location, is there a possible way to fix or workaround this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果启用 Aero,Windows 会欺骗您有关
Fixed*
FormBorderStyle
窗口的大小和位置。 以下代码显示如何获取此类窗口的正确高度和顶部偏移量。 类似的技术将允许您将窗口放置在 (0,0) 处。If Aero is enabled, Windows will lie to you about the size and position of
Fixed*
FormBorderStyle
windows. The following code shows how to get the correct height and top-offset of such a Window. A similar technique will allow you to place a window at (0,0).我想这样做的原因是允许我的应用程序(应用了皮肤)启用或禁用该皮肤。 整个应用程序与皮肤配合良好,我试图实现一个属性来启用和禁用皮肤。 这个主题的问题是我在禁用皮肤时遇到的问题之一。 然后我意识到,如果皮肤被禁用,我还有很多其他恼人的问题需要处理。 这意味着我现在会忘记这个功能并暂时让皮肤始终处于打开状态。 我现在只是没有时间处理这么多问题...
建议结束这个问题...
The reason I want to do this is to allow my application, which has a skin applied, to enable or disable that skin. The whole application is working fine with the skin and I was trying to implement a property to enable and disable the skin. The issue on this topic was one of the problems I'm having when the skin is disabled. I then realized that I also have a lot of other annoying problems to deal with if the skin is disabled. Which means I'll just forget about this feature for now and leave the skin always on in the time being. I just don't have the time to handle so many issues right now...
Proposing to close this question...