Board index » cppbuilder » Resizing forms

Resizing forms


2005-04-11 08:34:20 PM
cppbuilder31
Hi,
Is there a simple / standard way to update all of the controls on a form?
I have a form with several controls (buttons, TEdit etc.). I would like to
be able to change the font and size and still keep the controls aligned to
each other.
Regards,
Morten
 
 

Re:Resizing forms

Simple answer manually code it or find or purchase a vcl that will
automatically do it for you.
"Morten Nielsen" < XXXX@XXXXX.COM >wrote in message
Quote
Hi,
Is there a simple / standard way to update all of the controls on a form?
I have a form with several controls (buttons, TEdit etc.). I would like to
be able to change the font and size and still keep the controls aligned to
each other.

Regards,
Morten


 

Re:Resizing forms

"Morten Nielsen" < XXXX@XXXXX.COM >wrote:
Quote
Hi,
Is there a simple / standard way to update all of the controls
on a form? I have a form with several controls (buttons, TEdit
etc.). I would like to be able to change the font and size and
still keep the controls aligned to each other.
Yes, VCL controls have a ParentFont property which is usually
set to true. So setting the Forms Fonts changes the font for all
its controls too. To scale the controls you would call either
ScaleBy or ScaleControls.
Try this:
void __fastcall TForm1::Button1Click(TObject *Sender)
{
Font->Name = "Monotype Corsiva";
ScaleBy(2,5);
}
 

{smallsort}