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.
Printable View
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.
Try:This won't take into account the size and/or position of the TaskbarCode:Private Sub Form_Load()
Move (Screen.Width - Width), (Screen.Height - Height)
End Sub
is there a way to account for the taskbar, or will I just have to play around with it?
To my knowledge, unless you are max or full screen you won't cover the taskbar.
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?
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