How do you size your form in vb6 so that form lower border is at top of taskbar
Is there a reason you cannot just maximise the form? That would be my first impression.
If that's not a runner, you could try getting the taskbar height in the following way:
Private Const ABM_GETTASKBARPOS = &H5
Private Type RECT
Left As Long
Top As Long
Right As Long
Bottom As Long
End Type
Private Type APPBARDATA
cbSize As Long
hwnd As Long
uCallbackMessage As Long
uEdge As Long
rc As RECT
lParam As Long
End Type
Private Declare Function SHAppBarMessage Lib "shell32.dll" (ByVal dwMessage As Long, pData As APPBARDATA) As Long
Function GetTaskBarSize()
Dim ABD As APPBARDATA
SHAppBarMessage ABM_GETTASKBARPOS, ABD
MsgBox "Width:" & ABD.rc.Right - ABD.rc.Left
MsgBox " Height:" & ABD.rc.Bottom - ABD.rc.Top
End Sub
and then setting your form's height to the screen's height less the taskbar's height.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With