Recent

Author Topic: Get design time size of a Form at runtime?  (Read 212 times)

winni

  • Hero Member
  • *****
  • Posts: 1353
Get design time size of a Form at runtime?
« on: April 07, 2020, 09:52:06 pm »
Hi!

Is there an chance to get the design time size of a form at runtime -
after it may be resized a lot of times?

Winni

howardpc

  • Hero Member
  • *****
  • Posts: 3417
Re: Get design time size of a Form at runtime?
« Reply #1 on: April 07, 2020, 10:18:56 pm »
Could you not do something like this:
Code: Pascal  [Select][+][-]
  1. const
  2.   form_size: Types.TSize = (cx: 250, cy:300);  // or whatever ...
  3.  
  4. procedure TForm1.FormCreate(Sender: TObject);
  5. begin
  6.   SetInitialBounds(0, 0, form_size.cx, form_size.cy);
  7. end;  
where form_size if effectively the design time size?

winni

  • Hero Member
  • *****
  • Posts: 1353
Re: Get design time size of a Form at runtime?
« Reply #2 on: April 07, 2020, 10:27:11 pm »
Hi!

Thanx for the reply - I had the same idea.

I just asked if in the depth of TForm somewhere the design time size is hidden.

If not I will work with cx/cy const.

Winni

furious programming

  • Sr. Member
  • ****
  • Posts: 418
  • I click a little.
    • TreeStructInfo — format for text and binary configuration files
Re: Get design time size of a Form at runtime?
« Reply #3 on: April 08, 2020, 09:04:56 am »
I just asked if in the depth of TForm somewhere the design time size is hidden.

What about resources? There are hidden lfm's — as RCDATA, for all forms.

Use Resource Hacker or similar software and you'll see. 8)
« Last Edit: April 08, 2020, 09:16:23 am by furious programming »
Lazarus 2.0.6 with FPC 3.0.4 (SVN Revision 62129), Windows XP (all 32-bit)

 

TinyPortal © 2005-2018