Windows Phone Developers

Tuesday, August 24, 2010

How to Get Width and Height of Desktop Screen using C#/VB.NET

How to resize Windows form to fit Windows screen using C#/VB.NET

The following code resizes the Form Window to fit the entire screen .

int iWindowWidth = Screen.PrimaryScreen.Bounds.Width;
            int iWindowHeight = Screen.PrimaryScreen.Bounds.Height;
            this.Size = new Size(iWindowWidth, iWindowHeight ) ;
Digg Technorati Delicious StumbleUpon Reddit BlinkList Furl Mixx Facebook Google Bookmark Yahoo
ma.gnolia squidoo newsvine live netscape tailrank mister-wong blogmarks slashdot spurl StumbleUpon

2 comments:

  1. Useful to get maximum form size for an Windows application

    ReplyDelete
  2. getting error at screen..error(the screen does not exit in current context)

    ReplyDelete