برای کل صفحه (با در نظر گرفتن Task Bar)
Screen.PrimaryScreen.WorkingArea.Height
Screen.PrimaryScreen.WorkingArea.Width
برای صفحه با حذف اندازه Task Bar
ابتدا فضای نام زیر رو اضافه کنید
using System.Runtime.InteropServices;
سپس
[DllImport("SHELL32", CallingConvention = CallingConvention.StdCall)]
static extern uint SHAppBarMessage(int dwMessage, ref AppBarData pData);
struct Rect
{
public int left;
public int top;
public int right;
public int bottom;
}
struct AppBarData
{
public int cbSize;
public IntPtr hWnd;
public int uCallbackMessage;
public int uEdge;
public Rect rc;
public IntPtr lParam;
}
برای استفاده هم بصورت زیر استفاده کنید
AppBarData abd = new AppBarData();
SHAppBarMessage(5, ref abd);
abd.rc.top
abd.rc.bottom
abd.rc.left
abd.rc.right