Forum > LCL

GroupBox height

(1/2) > >>

asdf:
I would like to have each gap by value 8.
But the GroupBox1.Height was not enough.
How I can define the GroupBox1.Height by using this technique ?

procedure TForm1.FormCreate(Sender: TObject);
begin

edit1.AutoSize:=true;
edit2.AutoSize:=true;

groupbox1.Top:=8;
groupbox1.Left:=8;
groupbox1.Width:=edit1.Width+edit2.Width;
groupbox1.Height:=8+edit1.Height+8+edit2.Height+8;

edit1.Top:=8;
edit1.Left:=8;
edit2.Top:=edit1.Top+edit1.Height+8;
edit2.Left:=edit1.Left;

end;             

jixian.yang:
Did you try FormShow event?

asdf:
Never before.
Kindly help.

Or in only this case,
I need just to get the height of GroupBox1 with top margin (like) 8, gap between Edit1 and Edit 2 = 8 and bottom margin 8.

JuhaManninen:
GroupBox.Height <> GroupBox.ClientHeight

Child control's top coordinate is relative to GroupBox's client area, not to its absolute top.
This excludes GroupBox's border with caption, so you must make it bigger.
Size of the border depends on widget and theme settings.

Is Delphi this works differently, there child's top is relative to GroupBox's absolute top.

Juha

Blaazen:
In my project (with Qt), I use Edit1.Top:=0; in the same case and it seems good.

Navigation

[0] Message Index

[#] Next page

Go to full version