Use the SystemInformation class
[Csharp]
// The size of the Work Field on the current screen except the taskbar
String currentScreenSize_OutTaskBar = SystemInformation. WorkingArea. Width. ToString () + "," + SystemInformation. WorkingArea. Height. ToString ();
MessageBox. Show ("the size of the Work Field on the current screen except the taskbar is:" + currentScreenSize_OutTaskBar );
// The current screen contains the size of the work field of the taskbar
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 job field size of the taskbar:" + currentScreenSize );
// Taskbar size
Size OutTaskBarSize = 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 );
From Ouyang Xiaoyan