I want to align the positions of components in code.
For example, there are 5 components.
(e.g. WebImageControl, WebEdit, WebButton...)
If you try to sort by code in the WebFormShow() event as shown below,
It doesn't sort as intended.
However, when I hit refresh, it sorts as intended.
Is it because the page is sorted before it loads?
To sort the components...
In which event should I write code?
procedure Tfrm_Main.WebFormCreate(Sender: TObject);
begin
//
end;
procedure Tfrm_Main.WebFormShow(Sender: TObject);
begin
CompoInit();
end;
procedure Tfrm_Main.CompoInit();
begin
//-----
btnJoin.Left := (Width div 2) - (btnJoin.Width div 2);
btnJoin.Top := Height - btnJoin.Height - 70;
//-----
pnlInfo.Left := (Width div 2) - (pnlInfo.Width div 2);
pnlInfo.Top := btnJoin.Top - pnlInfo.Height - 20;
pnlInfo.Color := clWhite;
//-----
imgHp.Width := Width - 30;
SetImagePerBaseWidth(imgHp, imgHp.Width, true);
imgHp.Top := pnlInfo.Top - imgHp.Height - 20;
//-----
imgTop.Height := imgHp.Top;
SetImagePerBaseHeight(imgTop, imgTop.Height, true);
//-----
txtHp.Left := imgHp.Left + 8;
txtHp.Top := imgHp.Top + 8;
txtHp.Width := imgHp.Width - 16;
txtHp.Height := imgHp.Height - 16;
txtHp.Color := clWhite;
end;