Results 1 to 7 of 7

Thread: Get X,Y windows

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Dec 2009
    Posts
    23

    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.

  2. #2
    I'm about to be a PowerPoster! kleinma's Avatar
    Join Date
    Nov 2001
    Location
    NJ - USA (Near NYC)
    Posts
    23,373

    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)

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Dec 2009
    Posts
    23

    Re: Get X,Y windows

    Oh thank you

  4. #4
    Hyperactive Member gonzalioz's Avatar
    Join Date
    Sep 2009
    Location
    <body></body>
    Posts
    508

    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 .

  5. #5
    I'm about to be a PowerPoster! kleinma's Avatar
    Join Date
    Nov 2001
    Location
    NJ - USA (Near NYC)
    Posts
    23,373

    Re: Get X,Y windows

    Quote Originally Posted by gonzalioz View Post
    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.

  6. #6
    Hyperactive Member gonzalioz's Avatar
    Join Date
    Sep 2009
    Location
    <body></body>
    Posts
    508

    Re: Get X,Y windows

    Quote Originally Posted by kleinma View Post
    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.

  7. #7
    I'm about to be a PowerPoster! kleinma's Avatar
    Join Date
    Nov 2001
    Location
    NJ - USA (Near NYC)
    Posts
    23,373

    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
  •  



Click Here to Expand Forum to Full Width