Windows Forms color variation between Windows 7 and XP - windows

I have a vb.net Windows Forms app using the 4.0 framework. When I run the application on an XP machine, the color of my controls all match what the are set to in my IDE, which is also an XP machine.
When I run this application on a Windows 7 machine, the colors are all changed.
Any ideas why this is and how I can make Windows 7 match my Development machine?
David

Windows forms are going to take on whatever "theme" the machine they are running on has enabled - which is by design. Honestly, it wouldn't make sense for a windows form running on Windows 7 to look like an XP windows form. Could you give some sort of context for why you want your windows form to look like it's always running on XP?

You can use the BackColor property of the button to change the background color. The ForeColor property will change the text color.
Edit: added the below after playing around some.
Try ensuring the "UseVisualStyleBackColor" property on your button is set to False. Playing around I noticed that when this is true, the system ignores my background color selection and uses the machine default. When False, my background color was used.

I found this too. My VB6 project was fine in Windows XP.
I just moved to Windows 7 and copied the project folder to this machine.
My splashscreen backcolour was supposed to be white but it was black now.
The backcolour had been set to &H80000009& which was white in winXP but in Windows 7 it gives black.
So I changed backcolour to &H80000005& and it is now white again.

Related

SStab not appearing correctly in different OS's

I'm working on a legacy VB6 application in Windows 10. I'm currently trying to get the application to run seamlessly in Windows 10 and I'm coming across some issues. One of them is the SSTab control. See Image below:
Style, Tab Orientation, All the properties are identical, but as can be seen the text in Windows 7 looks proper vs Win 10. It seems to float left and when selected, one of the S's seems to get cut off the top and added in the 2nd line.
Anyone have any idea?
Try choosing Win 7 in the version part of compatibility. There is the App Compat Kit from MS that allows you to set thousands of compat settings rather than just a few common ones in that compatibility dialog https://www.microsoft.com/en-au/download/details.aspx?id=7352

Turn off cleartype/font-smoothing and panning # Win CE 7

Hi I got a lil problem with a mobile handheld computer (Motorola MC9200) running Windows CE 7.0.
Within the browser (Internet Explorer + software like Naurtech CETerm) there is some font-smoothing or cleartype. Problem about that is that , and font with a css style of font-weight 900 for example look exactly the same as normal font. So you can't tell the difference.
Another problem would be the panning. I'm running a fullscreen web application and the user shouldn't be able to pan the whole screen 1 cm out. Funny thing is while the user is panning the whole picture the font-smoothing/cleartype is disabled and you can tell the difference between font-weights.
Anyone no a solution to that? I already searched the registry for cleartype and font but didn't find anything helpful. I don't have other WinCE 7.0 devices so I don't know if that problem is WinCE 7.0 related or related to the device.
I don't have a device at hand, but WEC 7.0 offers the SystemParametersInfo function that sounds a bit like what you're after.
Call it with uiAction set to SPI_SETFONTSMOOTHING to disable ClearType on a system-wide basis:
SystemParametersInfo(SPI_SETFONTSMOOTHING, FALSE, NULL, SPIF_SENDCHANGE);
Earlier versions of Windows CE had a registry setting to allow OEM's to disable ClearType, but I've been unable to locate this setting in WEC 7.0, so my guess is it's no longer supported and ClearType is always enabled by default.

QT application style does not change between the different windows themes

Via qApp->setStyle you can change the style of your application. What I found is when I run on Windows 7 with windows 7 theme I can switch between:
qApp->setStyle(QStyleFactory::create("Windows"));
qApp->setStyle(QStyleFactory::create("WindowsVista"));
qApp->setStyle(QStyleFactory::create("WindowsXP));
But if I have my windows 7 setup with windows classic theme, I cannot switch between those 3. They all look the same.
How can I force my application to look like Windows Vista on Windows Classic theme PC?
Note: my system returns for QStyleFacory::keys():
Windows
WindowsXP
WindowsVista
Fusion
That's correct. On Windows, the "Vista" and "XP" themes are only active if you're using the same or higher theme on the user account. That's not due to Qt, but due to the behavior of the theming APIs on Windows.

White UI Automation compiled in x86 (XP) does not work for W7 (64bit)

I'm trying on control a openfile dialog box through White. I develop the test application in XP (x86) and it works fine. The application an write into the selected filename combobox and click in the open button.
I tried to use the same test application in Windows7, and it seems that White is not able to write into the combobox nor click in the open button. This is normal?
Yes, it's normal when you trying to access 32bit app under test from 64bit test app.
I use xUnit with tests packed into class libraries. Forcing 'Platform target' to x86 does the trick - all White features work.
I found out that White compiled in x86 does not input keystrokes nor clicks when run in Win7. However, it does detect and set focus on selected UIitem.
I solved the issue simulating Windows keystrokes in c#. hope it is useful for someone.

SWT setForeground in Windows 7 vs. Windows XP

We have SWT apps which use the setForeground method on windows XP, and they work fine. However, running the most recent stable SWT jars and dlls on Win7 seems to show the setForeground method being ignored. I know that the javadoc says it's a hint, but I wanted to know if this is because something changed between XP and 7, or if it's possible it's a system setting on my new Win7 install.
I had found this post: How to set SWT button foreground color?, but the main answer definitively says that setForeground is ignored on Windows, which isn't true in XP. Also, our problem doesn't seem to be limited to Buttons. Same issues happen with Groups as well.
Apparently, a hacky work-around exists by adding a paint listener that manipulates the GC directly to redraw the text with the appropriate color, besides being hacky, this is not practical, because it would mean we had to add this listener to the thousands places where we use Buttons.
Thanks for any help.
This doesn't have anything to do with your system settings. It's just that, as you have guessed, something has changed between XP and 7. Actually, it changed between XP and Vista. Unfortunately there is not much you can do about this, except for the hack that you have mentioned.
For more information, see this bug report.
Further investigation reveals that this is not a difference between XP and Windows 7, but rather the Classic theme vs the Aero or XP theme. If we use the XP theme in XP, Button foreground also cannot be set.

Resources