Fellows, I need to stick my form in top right corner, I search in google, and found some codes, but I'm really newbie in computer programming, and don't know how to use it or even if it will work.
Here is the code
procedure MoveFormToTopOfRightmostMonitor(Form: TForm);
var
i: Integer;
Monitor, RightMostMonitor: TMonitor;
begin
RightMostMonitor := Screen.Monitors[0];
for i := 1 to Screen.MonitorCount-1 do
begin
Monitor := Screen.Monitors;
if Monitor.Left+Monitor.Width > RightMostMonitor.Left+RightMostMonitor.Width then
Monitor := RightMostMonitor;
end;
Form.Left := Monitor.Left+Monitor.Width-Form.Left;
Form.Top := Monitor.Top;
end;
If it works, can some one explain where did I use it, and if I'm not asking too much, comment line per line ?
It works in the on create event of the form ?
Thanks to advice.