The button has a black background in Windows 7

I am currently moving the application targeting WIndows XP and Server 2003 to Windows 7 (and later). Most applications work well, but some buttons have a black background in Windows 7.

Add a machine in Windows XP Windows XP

Add Machine Dialog in Windows 7 Windows 7

The application targets .NET v2.0 in Visual Studio 2005 (as soon as the transition to Windows 7 is complete, we will move to later versions of .NET and Visual Studio). None of the available properties seem to help. Here is a list of properties that I thought might matter (the same for XP and 7):

BackColor = ActiveCaptionText
BackgroundImage = (none)
TileBackgroundImageLayout = Tile
ForeColor = ControlText
TextImageRelation = Overlay
UseVisualStyleBackColor = False (changing to True doesn't help)

What needs to be done to get buttons similar to Windows XP?

+4
source share
1 answer

ActiveCaption SystemColors. .

http://msdn.microsoft.com/en-us/library/system.drawing.systemcolors.aspx

- .

, BackColor Control, , :

BackColor = SystemColors.Control;

.

+3

Source: https://habr.com/ru/post/1666922/


All Articles