【发布时间】:2017-01-16 14:48:04
【问题描述】:
我目前正在将针对 WIndows XP 和 Server 2003 的应用程序迁移到 Windows 7(及更高版本)。大多数应用程序运行良好,但某些按钮在 Windows 7 中具有黑色背景。
该应用程序面向 Visual Studio 2005 中的 .NET v2.0(一旦迁移到 Windows 7 完成,我们将迁移到更高版本的 .NET 和 Visual Studio)。可用的属性似乎都没有帮助。以下是我认为可能相关的属性列表(在 XP 和 7 上相同):
BackColor = ActiveCaptionText
BackgroundImage = (none)
TileBackgroundImageLayout = Tile
ForeColor = ControlText
TextImageRelation = Overlay
UseVisualStyleBackColor = False (changing to True doesn't help)
需要做什么才能让按钮看起来像在 Windows XP 上的样子?
【问题讨论】:
-
您将按钮颜色设置为操作系统定义的 ActiveCaptionText。显然在这台机器上颜色是黑色的。手动将颜色设置为
Color.Grey或任何 RGB 值。