C#中多屏現實--Screen類的使用

來源:互聯網
上載者:User

標籤:c#   screen   多屏顯示   

Screen類

表示單個系統上的一個或多個顯示裝置

命名空間:System.Windows.Forms

程式集:System.Windows.Forms(在System.Windows.Forms.dll中)

文法:public class Screen

此對象的建構函式不是公用的,因此無法顯示建立Screen對象,該對象在調用公用方法時建立。

Screen.AllScreens屬性:

擷取系統上所有顯示器的數組。

文法:public static Screen[] AllScreens{get;}

Screen.WorkingArea屬性:

擷取顯示器的工作區。工作區是顯示器的案頭地區,不包括工作列、停靠視窗和停駐工具列。

文法:public Rectangle WorkingArea{get;}

例如:MyScreen是一個視窗,聲明一個視窗的對象my_screen

MyScreen my_screen;

System.Windows.Forms.Screen s2 = System.Windows.Forms.Screen.AllScreens[0];

System.Drawing.Rectangle r2 = s2.WorkingArea;

my_screen.Top = r2.Top;

my_screen.Left = r2.Left;

my_screen.Width = r2.Width;

my_screen.Height = r2.Height;

my_screen.Show();

my_screen.WindowState = System.Windows.WindowState.Maximized;

著作權聲明:本文為博主原創文章,未經博主允許不得轉載。

C#中多屏現實--Screen類的使用

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.