Results 1 to 5 of 5

Thread: [RESOLVED] Getting the screen area in VB.Net

Threaded View

  1. #1

    Thread Starter
    Fanatic Member InvisibleDuncan's Avatar
    Join Date
    May 2001
    Location
    Eating jam.
    Posts
    819

    Resolved [RESOLVED] Getting the screen area in VB.Net

    Our users like to have their forms open up in the same place each time they use them (i.e. so that they open up in the position they were in when they were previously closed), so we store the location of each form when they close it, and re-apply that location each time they open it. Easy.

    However, we have a problem with some users who sometimes use one monitor, and sometimes use two - there have been instances where they closed a form while it was on their second (right-hand) monitor and then try to open it on a laptop with only one screen... and it sticks the form out of sight to the right.

    I can get around this easily on the VB6 forms by using:

    SystemParametersInfo(SPI_GETWORKAREA, vbNull, pRect, 0)

    ... to determine how big the screen they're currently using is, and overriding their settings if it would otherwise mean the form being out of sight. However, I can't get it to work in VB.Net - the RECT structure always returns 0 for all positions. So, does anyone know how to get the screen size using VB.Net?

    Thanks...
    Last edited by InvisibleDuncan; Dec 6th, 2007 at 04:09 AM. Reason: Resolved
    Indecisiveness is the key to flexibility.

    www.mangojacks.com

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width