【C#】透屏幕,屏幕扩展
1 if (!SCREEN_STATE) 2 { 3 if (System.Windows.Forms.Screen.AllScreens.Count() > 1) 4 { 5 System.Windows.Forms.Screen s2 = System.Windows.Forms.Screen.AllScreens[1]; 6 System.Drawing.Rectangle r2 = s2.WorkingArea; 7 bigScreen = new BigScreen(); 8 9 bigScreen.GridMainContent.Children.Clear(); 10 TeamDataPage s = new TeamDataPage(); 11 bigScreen.GridMainContent.Children.Add(s); 12 13 bigScreen.Top = r2.Top; 14 bigScreen.Left = r2.Left; 15 bigScreen.Width = r2.Width; 16 bigScreen.Height = r2.Height; 17 bigScreen.Show(); 18 bigScreen.WindowState = WindowState.Maximized; 19 btn_BigScreen.Content = " 停止显示 "; 20 SCREEN_STATE = true; 21 } 22 else 23 { 24 MessageBox.Show("找不到扩展屏幕!"); 25 } 26 } 27 else 28 { 29 btn_BigScreen.Content = " 大屏显示 "; 30 if (bigScreen != null) 31 bigScreen.Close(); 32 33 SCREEN_STATE = false; 34 }
1、根据屏幕宽度,将要透屏的内容显示在主屏幕宽度之外!