Color change of Windows Forms between Windows 7 and XP

I have a vb.net Windows Forms application using framework 4.0. When I run the application on an XP computer, the color of my controls matches what is installed in my IDE, which is also an XP machine.

When I run this application on a computer running Windows 7, all colors change.

Any ideas why this is the case, and how can I get Windows 7 to fit my development machine?

David

-2
source share
3 answers

Windows forms are going to take on any "theme" that runs the machine on which they work - which is by design. Honestly, it would be pointless if the window form running on Windows 7 looked like a Windows XP form. Could you give some context, why do you want your window shape to look like it always works on XP?

+2
source

You can use the BackColor property to change the background color. The ForeColor property will change the color of the text.

Edit: added below after you played around.

Try to make sure that the UseVisualStyleBackColor property on your button is set to False. When playing, I noticed that when it is true, the system ignores my choice of background color and uses the default machine. When False, my background color was used.

0
source

I also found this. My VB6 project was great on Windows XP. I just switched to Windows 7 and copied the project folder to this machine. My splash guard backlight should have been white, but now it was black. The reverse color was set to H80000009 & which was white in winXP, but in Windows 7 it is black. So I changed the color back to H80000005 and now it's white again.

0
source

All Articles