TComboBox.Height problems under Windows 7 High DPI modes
Original Reporter info from Mantis: lainz
-
Reporter name:
Original Reporter info from Mantis: lainz
- Reporter name:
Description:
I know TComboBox on Windows can't set Height. The problem under high dpi modes is that reading TComboBox.Height property always read the stored height in the .lfm, this is wrong for TComboBox because their height is changed by the System.
If I save and compile my project in 96 dpi (100%) the ComboBox.Height is 23, when i run the application in 120 dpi (125%) or other the ComboBox.Height is the same when I compiled, but the displayed Height is different.
The expected Height is the displayed, not the stored in the .lfm (only for Windows).
Steps to reproduce:
- Add a TComboBox in a Form, Windows DPI 96 (100%) and add a ShowMessage(IntToStr(ComboBox1.Height)) OnShow event of Form1.
- Compile and Run, remember the displayed value.
- Change Windows DPI setting to 120 (125% or bigger).
- Run the compiled application, the displayed value is same as before, but the ComboBox1 is bigger.
- Change some text in unit1 or change the ComboBox1 properties to make Lazarus change the stored size of ComboBox1 in the .lfm
- Compile and Run, now the value is different (bigger, the height of ComboBox1 under the selected DPI setting).
- If you run the last compiled executable in other dpi setting (like 96 dpi) the displayed value OnShow is the same.
Additional information:
Tested only under Windows, this because the known bug "never will be fixed" in TComboBox: TComboBox.Height is relative to Font.Height >> the Font.Height is changed automatically under different DPI modes.
If you change the Font.Height in Form1 or ComboBox1 the Height is changed too.
Mantis conversion info:
- Mantis ID: 18342
- OS: Windows
- OS Build: 7
- Build: 28822
- Platform: i386
- Version: 0.9.31 (SVN)
- Monitored by: » scribly (Eric Heijnen)