Results 1 to 6 of 6

Thread: max top and left

  1. #1

    Thread Starter
    The Devil crptcblade's Avatar
    Join Date
    Aug 2000
    Location
    Quetzalshacatenango
    Posts
    9,091
    Is there like a maxleft or maxtop property? because I want the startup form of my app to show up in the very bottom right corner of the screen, no matter what the resolution of the screen might be.

  2. #2
    Guru Aaron Young's Avatar
    Join Date
    Jun 1999
    Location
    Red Wing, MN, USA
    Posts
    2,177
    Try:
    Code:
    Private Sub Form_Load()
        Move (Screen.Width - Width), (Screen.Height - Height)
    End Sub
    This won't take into account the size and/or position of the Taskbar

  3. #3

    Thread Starter
    The Devil crptcblade's Avatar
    Join Date
    Aug 2000
    Location
    Quetzalshacatenango
    Posts
    9,091
    is there a way to account for the taskbar, or will I just have to play around with it?

  4. #4
    _______ HeSaidJoe's Avatar
    Join Date
    Jun 1999
    Location
    Canada
    Posts
    3,946

    <?>

    To my knowledge, unless you are max or full screen you won't cover the taskbar.
    "A myth is not the succession of individual images,
    but an integerated meaningful entity,
    reflecting a distinct aspect of the real world."

    ___ Adolf Jensen

  5. #5

    Thread Starter
    The Devil crptcblade's Avatar
    Join Date
    Aug 2000
    Location
    Quetzalshacatenango
    Posts
    9,091
    what i meant is, I want the form to be all the way to the right(which the move() code does) and right above the taskbar(which the move() code doesn't do). how do I get that position?

  6. #6
    Guru Aaron Young's Avatar
    Join Date
    Jun 1999
    Location
    Red Wing, MN, USA
    Posts
    2,177
    You could do something like:
    Code:
    Private Declare Function GetDesktopWindow Lib "user32" () As Long
    Private Declare Function LockWindowUpdate Lib "user32" (ByVal hwndLock As Long) As Long
    
    Private Sub Form_Load()
        Call LockWindowUpdate(GetDesktopWindow())
        WindowState = vbMaximized
    End Sub
    
    Private Sub Form_Resize()
        Static bDone As Boolean
        Dim X As Single, Y As Single
        
        If Not bDone Then
            X = Screen.Width - Width
            Y = Screen.Height - Height
            WindowState = vbNormal
            Move (Screen.Width - X) - Width, (Screen.Height - Y) - Height
            Call LockWindowUpdate(0)
        End If
    End Sub

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