C # Get the size of the screen
WinForm:
int iactulawidth = Screen.PrimaryScreen.Bounds.Width;
int iactulaheight = Screen.PrimaryScreen.Bounds.Height;
Under WPF:
Double dwidth = System.Windows.SystemParameters.PrimaryScreenWidth;
Double dheight = System.Windows.SystemParameters.PrimaryScreenHeight;
Double dWidth2 = actualwidth; Gets the rendering width of this element. If this element is full-screen, you can get the screen size (-_-!!! )
Double dHeight2 = ActualHeight; Gets the rendering height of this element.
Using the SystemInformation class
[CSharp]
The size of the current screen in addition to the Work field outside the taskbar
String currentscreensize_outtaskbar=systeminformation.workingarea.width.tostring () + "," + SystemInformation.WorkingArea.Height.ToString ();
MessageBox.Show ("The current screen has a working field size other than the taskbar:" +currentscreensize_outtaskbar);
The current screen includes the task bar's working field size
String currentscreensize=system.windows.forms.screen.primaryscreen.bounds.width.tostring () + "," + System.Windows.Forms.Screen.PrimaryScreen.Bounds.Height.ToString ();
MessageBox.Show ("The current screen includes the task bar's working field Size:" +currentscreensize);
Task bar Size
Size uttaskbarsize = new Size (SystemInformation.WorkingArea.Width, SystemInformation.WorkingArea.Height);
Size screensize = new Size (System.Windows.Forms.Screen.PrimaryScreen.Bounds.Width, System.Windows.Forms.Screen.PrimaryScreen.Bounds.Height);
Size taskbarsize;
Taskbarsize = new Size (
(Screensize.width-(screensize.width-outtaskbarsize.width)),
(Screensize.height-outtaskbarsize.height)
);
MessageBox.Show ("Taskbar size:" + taskbarsize.width + "," + taskbarsize.height);
C # Gets the size of the screen SystemInformation class