|
-
Dec 23rd, 2009, 10:22 AM
#1
Thread Starter
Junior Member
Get X,Y windows
Hi folks
I been do some googling but it doesnt still answer my question
Me.Bottom: is this get the X coordinate in the lowest x of the screen
I only ask this because when i use me.bottom it returns 822 when my screen resolution is only 800 and my form height is only 750.
Also when i use this function in different class it returns 300 when me forms is 750
Well i just want to know the code which get the height of my screen not including xp toolbar
Thank you
Last edited by TChaiyaphanVBF; Dec 23rd, 2009 at 10:30 AM.
-
Dec 23rd, 2009, 10:33 AM
#2
Re: Get X,Y windows
me.bottom is the amount of pixels between the bottom of the control that "me" represents, and the top of the container that the control is sitting in. A form has no container, so the desktop is used, however if you look at the bottom property for lets say a button, it is the distance in pixels from the bottom of the button to the top of the form.
If you want to get the screen real estate for the screen the form is in, excluding the taskbar, use something like this:
Code:
Dim CurrentScreen As Screen = Screen.FromControl(Me)
MessageBox.Show("The current working area of the screen is: " & CurrentScreen.WorkingArea.ToString)
-
Dec 23rd, 2009, 10:35 AM
#3
Thread Starter
Junior Member
-
Dec 23rd, 2009, 10:46 AM
#4
Hyperactive Member
Re: Get X,Y windows
Hi,
Bottom, left, right and top functions return the amount of space in pixels between them and their parent control.
You can get the resolution of your screen without the windows taskbar using the My class:
Code:
My.Computer.Screen.GetWorkingArea
If you want the screen resolution including the windows taskbar you have to use:
Code:
My.Computer.Screen.GetBounds
[EDIT]
O lol... somebody already replied. Forgot to refresh .
-
Dec 23rd, 2009, 10:50 AM
#5
Re: Get X,Y windows
 Originally Posted by gonzalioz
Hi,
Bottom, left, right and top functions return the amount of space in pixels between them and their parent control.
You can get the resolution of your screen without the windows taskbar using the My class:
Code:
My.Computer.Screen.GetWorkingArea
If you want the screen resolution including the windows taskbar you have to use:
Code:
My.Computer.Screen.GetBounds
[EDIT]
O lol... somebody already replied. Forgot to refresh  .
Just remember that my.computer.screen returns the primary display, which is not always the one an application may be open in. I have 4 LCDs, and most of the time an app is not going to be in my primary monitor.
-
Dec 23rd, 2009, 10:54 AM
#6
Hyperactive Member
Re: Get X,Y windows
 Originally Posted by kleinma
Just remember that my.computer.screen returns the primary display, which is not always the one an application may be open in. I have 4 LCDs, and most of the time an app is not going to be in my primary monitor.
Good point, thanks.
4 lcd's tsss. You only have two eyes. I think 2 screens is enough. 4 is if your too lazy to use the windows taskbar and keeping all your windows open . But then again, that might not be a bad habit. Because when windows freezes you can still write down the info on your screen or take a picture of it hahaha.
-
Dec 23rd, 2009, 10:57 AM
#7
Re: Get X,Y windows
MSDN documentation up in 1 window, VS IDE in another, running app I am debugging in the 3rd, and of the 4th is generally used for outlook and VBforums
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|