Recent

Author Topic: The form width and control width not match  (Read 426 times)

LemonParty

  • Sr. Member
  • ****
  • Posts: 438
The form width and control width not match
« on: February 24, 2026, 10:41:35 pm »
In FormCreate event I do:
Code: Pascal  [Select][+][-]
  1. TImage.Width:= Width;
and visually TImage have the same size like form. But then, in different procedure I set up a breackpoint and see that TImage.Width is 196 when form width is 360. I have a High DPI screen. How is this happening?
Lazarus v. 4.99. FPC v. 3.3.1. Windows 11

wp

  • Hero Member
  • *****
  • Posts: 13484
Re: The form width and control width not match
« Reply #1 on: February 25, 2026, 01:54:26 am »
OnCreate may be too early. Put your code into OnActivate or OnShow or OnResize.

 

TinyPortal © 2005-2018