2010-09-18 56 views

回答

6

使用Screen對象。

獲取監視器計數

ShowMessage(IntToStr(Screen.MonitorCount)) 

獲取監視器細節

Screen.Monitors[i].Left (integer) 
        .Top (integer) 
        .Width (integer) 
        .Height (integer) 
        .BoundsRect (TRect) 
        .WorkareaRect (TRect) 
        .Primary (boolean) 

其中i是監視器的指數,即,I = 0,1,... ,Screen.MonitorCount - 1

所以,舉例來說,使窗體佔據整個第i個監視器,使用

BoundsRect := Screen.Monitors[i].BoundsRect; // or you could make the rect smaller 
WindowState := wsMaximized; // possibly 
+4

當然,對於非常簡單情況下,設置'DefaultMonitor'屬性可能足夠滿足某些需求。 – 2010-09-18 15:02:40