Common controls

When I change the colours of Windows or the theme, the controls change their size and position. How can I ensure that the common controls I am using retain the same dimensions?
I am not a high-expert here, but I would try locking the font size or style in your program. I believe the root cause is the font change, the colors wouldn't affect it. If you do not want to do that, you are going to have to resize to fit dynamically, which is a hassle.
Well, not having a sample of your code makes it hard to troubleshoot via crystal ball. The problem could be:

1. something related to your OS (Win7? WinXP? Win10?)

2. the compiler you use
2a. the framework you use to create the app (WinAPI, MFC, etc)

3. the version of the CC you invoke, this can be related to your OS version.

4. or something very particular to your system, unreproduceable on another.

You shouldn't change the Windows colors or themes when running your app. If you do make such a change you should probably force an entire repaint of the controls.

I've never seen something like what you describe, but then I don't change themes or Windows colors willy-nilly when I am running apps.

Creating an SSCCE (Short, Self Contained, Correct (Compilable), Example) would be beneficial.
http://www.sscce.org/
How do I lock the font size?
Does your program handle DPI change? or is it DPI aware (ex. trough manifest)?
Do you handle theme change message?
Do your common controls use enhanced styles (ex. also trough manifest)?

This are some of the factors that can cause inconsistency.
I've decided not to continue with this issue as it is a minor one and not worth pursuing. As long as you don't change your theme while running the app things behave themselves. You can close the app change the theme and then start the app again.
Registered users can post here. Sign in or register to post.