Answer the question
In order to leave comments, you need to log in
How to stretch a form across multiple monitors?
Hello!
How to stretch a form across multiple monitors?
Now I'm stretching it to full screen like this:
Form2.Width := Screen.DesktopWidth;
Form2.Height := Screen.DesktopHeight;
Answer the question
In order to leave comments, you need to log in
Try also setting Left and Top
Form2.Left := Screen.DesktopLeft;
Form2.Top := Screen.DesktopTop;
The Vcl.Forms module has a TScreen class through which you can enumerate monitors and get their properties.
The class does not need to be created, it is already created in the global variable Screen
Like this:
i, TotalWidth , TotalHeight : Integer;
for i = 0 to Screen.MonitorCount -1 do
begin
TotalWidth := TotalWidth + Screen.Monitors[i].Width;
TotalHeight := TotalHeight + Screen.Monitors[i].Heigth;
end;
Form.Width := TotalWidth;
Form.Heigth := TotalHeight ;
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question