how to detect display resolution

thexero

Active member
Joined
Jan 27, 2007
Messages
26
Programming Experience
3-5
hi

i made a program that has to start 100 pixcel left from the right of the screen and 50 pixcels from the bottom

it is rather fustrating when i have users with other screen resolutions to mine

any help

cheers
 
My.Computer.Screen is a shortcut to the PrimaryScreen instance of Screen class, Bounds property is the full screen rectangle.
 
My.Computer.Screen is a shortcut to the PrimaryScreen instance of Screen class, Bounds property is the full screen rectangle.

My.Computer.Screen as apposed to Screen.PrimaryScreen? :p

i apprechiate the help

but i'm struggling here :(

any clues

What are you struggling with?
 
My.Computer.Screen as apposed to Screen.PrimaryScreen? :p
Yes, it's a mental shortcut if you didn't remember where you put it. :D
Q: I can't find my screen?
Helpdesk: It's connected to your Computer, follow the wires...
The whole My feature is about being an intuitive approach to different code objects and shortcuts for small common code patterns.
 
i need to find the full boundries, thanks for help with that

but i don't know how to take that and chose the section above the system clock

i think i don't put a - but something else, but now sure what
 
That is the WorkingArea rectangle of the Screen.
 
this bit confuses me

Me.Location = New System.Drawing.Point(5, 5)

i'm not sure what to put here

There isn't anything else to put there. All that code does is set your form's top property 5 pixels down from the top of the monitor screen and it sets the form's left property 5 pixels to the right of the screen.

What you need to do next is use the WorkingArea of the Screen.PrimaryScreen (or My.Computer.Screen) to get the screen's width and height so you can set your form's width and height (be sure to subtract 10 from both when assigning the values).

Would you like a small demo for this?
 
i thought i had to put

me.location = workingarea(-100,-50)

or something along those lines

i have attatched a file

that is what i am tryin to achieve automatically with every resolution (i have had to manually set the resolution for mine so fare)

also a demo would be very nice

cheers
 
Last edited:
How about setting WindowsState to Maximized value?
 
Here's a demo, it simply shows you how to assign the Top, Left, Width and Height of a form with the width and height getting information from the Screen class.
 
i been a bit busy lately

but that demo didn't seem very helpful at first

but now i am very grateful you made it for me :D

it gaves me lots of ideas using

VB.NET:
me.top = screen.primaryscreen.workingarea.bottom

so using the opposite to top

and the same with the left

i just want to thank you programmers soo much for helping me out on this

really happy now

cheers
 
Back
Top