禁用主题窗口边框
在 Windows XP 的 CMD 中,Luna 边框不适用。 替代文本 http://wedowebstuff.info/uploads/1272861285CMDNotThemed%5D.png
是对于应用程序,是否可以在 Visual C# Winforms 中以类似的方式执行此操作?我只是想知道它是如何完成的,当然我不会强迫我的任何应用程序不使用漂亮的 XP/Aero 主题:P
谢谢。
编辑:几个月后为此添加注释。 Luna 边框不适用于 CMD,因为它在技术上是一个 16 位(旧)应用程序,因此它不使用标准 Windows 主题系统(也不使用窗口,正如它无法最大化的事实所证明的那样) )。此类应用程序在 32 位 Windows 中很常见(16 位应用程序在 x64 Windows 版本中已删除),例如 sysedit。事实上,它在 Vista/7 中具有正确主题的窗口边框(但请注意,不是内部控件),这是由于 Aero/Desktop 窗口管理器 (DWM) 覆盖所有窗口边框并呈现它们。如果我们切换到基本/经典主题,这种不一致现象仍然存在。
x64 cmd.exe 没有这个问题。 :)
In Windows XP's CMD, the Luna border isn't applied to it. alt text http://wedowebstuff.info/uploads/1272861285CMDNotThemed%5D.png
Is it possible to do it in a similar way in Visual C# Winforms, for an application? I just wonder how it's done, of course I am not going to force any of my applications to not use the beautiful XP/Aero theme :P
Thanks.
edit: Adding a note to this after many months. The Luna border isn't applied to CMD due to the fact that it is technically a 16-bit (old) application, so it does not use the standard Windows theming system (nor windowing, as demonstrated by the fact that it cannot be maximized). Applications like this are common in 32-bit windows (16-bit apps were removed in x64 Windows builds), for example, sysedit. The fact that it has a properly themed window border (but note, not the inside controls) in Vista/7, is due to the fact that Aero/Desktop Window Manager (DWM) overrides all window borders and renders them. If we switch to the Basic/Classic theme, that inconsistency continues.
The x64 cmd.exe doesn't have this problem. :)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我不知道如何修改边框,但顺便说一句,我确实知道如何控制控件的外观。据我所知(我是一名 Linux 程序员,所以我在这个领域的知识有限),如果不启用 XPCommonControls,您将拥有“旧式”控件,但有了它,您将拥有样式为系统风格设置。
I don't know how to modify the border, but on a side note, I do know how you can control the appearance of controls. As far as I know (I am a Linux programmer so I have limited knowledge in this field), without XPCommonControls enabled, you will have "old-style" controls, but with it, you will have "nice" buttons that are styled with the system style settings.