Common controls

Aug 26, 2021 at 3:34pm
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?
Aug 26, 2021 at 3:45pm
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.
Aug 26, 2021 at 5:11pm
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/
Aug 26, 2021 at 7:07pm
How do I lock the font size?
Aug 26, 2021 at 7:16pm
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.
Aug 27, 2021 at 4:50pm
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.
Topic archived. No new replies allowed.