Quick Question: Finding the size of the screen

Gluttard

Active member
Joined
Jan 9, 2008
Messages
44
Programming Experience
Beginner
Hey guys, I need to find what line of code gives the user the size of the monitor, I thought that it would be:
PHP:
Expand Collapse Copy
Clientsize.Width
Clientsize.Height
But alas, that is only for the program.

Also, how could I find this information myself?
 
The Bounds property of the Screen will give you the resolution of the monitor. WorkingArea will give you the area available to you, so it will account for the Windows Taskbar and the like.
 
Ehh, alright so I had found that out on my own, which is good news, but there's one problem.

I want to be able to find the Width of the screen and the Heigher, so I can compare that to an X and Y value, how could I do that?
 
Well if I put this in:
PHP:
Expand Collapse Copy
        If Cursor.Position.X > Bounds.Width Then
            MsgBox("Utmost Right Reached")
        End If

Well in my program it won't have that messagebox, but this is a new form where I'm testing this code.

But the messagebox pops up when my cursor is very far from the edge of my screen.
 
If you're using that code as is then you're using the Bounds of your form, not the screen. If you want the bounds of the screen then you have to use Screen.PrimaryScreen.Bounds. You can't just use Bounds and it magically know that you mean the screen bounds.
 
Back
Top