Auto-centering of a panel in the visible area of the screen


Is there a method for a panel to automatically adapt to the center in the visible area of the screen even if the browser window is resized?

In TWebPanel or in TTMSFNCPanel.

I need this functionality for a user validation panel at startup. So that it always appears in the center of the screen regardless of the monitor resolution, etc.

Thanks !


I found the solution in the other topics..

The solution is:

procedure TForm3.WebFormResize(Sender: TObject);
jsr: TJSDOMRect;
jsr := document.body.getBoundingClientRect;

webpanel1.Left := Round((jsr.right - jsr.left - webpanel1.Width) / 2);

1 Like

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.