Jump to content
Sign in to follow this  
Gustav Schubert

ClientHeight in FormResize screen scaling issue

Recommended Posts

FMX Rio: ClientHeight is not up to date in FormResize when the form is moved back from a second monitor which has a higher value screen scale. Can this be reproduced in 10.4? If so I would report it, and update this post.


Minimal sample with problem in 10.3.3:

  1. New app with one TRectangle on main form.
  2. Add OnResize handler as given below.
  3. Run on Windows.
  4. Test with two monitors of different scaling. Main monitor = 1.0 and second monitor to the right = 1.25.
  5. Drag Form1 from one monitor to other and then back to see problem.
  6. Drag the right border of form to resize again and correct the problem.
  • Problem shows after dragging back from right to main monitor.
  • There is a gap between Rectangle.Bottom and Form.Bottom.
  • It seems to be the diff in actual and perceived ClientHeight, 8 pixel in my setup.
  • Problem will be corrected if form is resized, because then ClientHeight will be good in FormResize.
procedure TForm1.FormResize(Sender: TObject);
  { Rectangle1: TRectangle }
//  Rectangle1.Width := ClientWidth - Rectangle1.Position.X;
  Rectangle1.Height := ClientHeight - Rectangle1.Position.Y;
  Caption := Format('%d - %d - %.2f', [Height, ClientHeight, Rectangle1.Scene.GetSceneScale]);


Share this post

Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this