Home All Groups Group Topic Archive Search About

Detect Screen Resolution

Author
2 Jun 2006 12:29 AM
A. Gaubatz
Does anyone know a fast and easy way of detecting the user's current
screen resolution in VB.NET?

Thanks in advance,


*** Sent via Developersdex http://www.developersdex.com ***

Author
2 Jun 2006 1:16 AM
ShaneO
A. Gaubatz wrote:
> Does anyone know a fast and easy way of detecting the user's current
> screen resolution in VB.NET?
>
> Thanks in advance,
>
>
> *** Sent via Developersdex http://www.developersdex.com ***

Dim ScrnRes As Rectangle = Screen.PrimaryScreen.Bounds
Dim W As Integer = ScrnRes.Width
Dim H As Integer = ScrnRes.Height

Also remember -

Dim ScrnRes As Rectangle = Screen.PrimaryScreen.WorkingArea

Hope this helps

ShaneO

There are 10 kinds of people - Those who understand Binary and those who
don't.
Author
2 Jun 2006 1:39 AM
ewok66
If you are using .Net 2.0, you can use:

My.Computer.Screen.PrimaryScreen.Bounds.Height
My.Computer.Screen.PrimaryScreen.Bounds.Width

--
--ewok
MCSA+M,MCSE, MCSD, MCDBA,MCITP


Show quoteHide quote
"A. Gaubatz" wrote:

> Does anyone know a fast and easy way of detecting the user's current
> screen resolution in VB.NET?
>
> Thanks in advance,
>
>
> *** Sent via Developersdex http://www.developersdex.com ***
>
Author
2 Jun 2006 7:10 PM
A. Gaubatz
Thanks!

*** Sent via Developersdex http://www.developersdex.com ***