2011-10-19 2 views

답변

7

여기서 주요 복잡 요인은 다중 모니터입니다. 여러 대의 모니터를 사용하는 경우 바탕 화면에 위쪽과 오른쪽이 모두 표시되지 않을 수 있습니다. 이 경우에 당신이 생각할 수있는 것은 가장 오른쪽 모니터의 상단 일 것입니다.

이처럼 수행

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[i]; 
    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; 
+0

@rakesh을보십시오. 'Form.Top'을 잘못 설정했습니다. 지금 보시는 버전을 사용하십시오. –

+0

@rakesh 질문에 대한 대답이라면 동의하십시오. 요즘이 단계를 잊어 버린 것 같습니다. –

0

난 그냥 코드에서 오류가 고정이

procedure TmainForm.FormCreate(Sender: TObject); 
begin 
mainForm.left:= screen.Monitors[Screen.MonitorCount-1].Width-mainForm.Width; 
end; 
관련 문제