If I choose form windowState=Maximized and BorderStyle=1. This form will cover my windows tast bar when it is running.
What should I do to keep BorderStyle=1 and Full fill the window except for the task bar?
Thanks
Printable View
If I choose form windowState=Maximized and BorderStyle=1. This form will cover my windows tast bar when it is running.
What should I do to keep BorderStyle=1 and Full fill the window except for the task bar?
Thanks
Instead of setting the windowstate to maximized, do this:
VB Code:
Option Explicit Private Declare Function SystemParametersInfo Lib "user32" Alias "SystemParametersInfoA" ( _ ByVal uAction As Long, _ ByVal uParam As Long, _ lpvParam As Any, _ ByVal fuWinIni As Long) As Long Private Const SPI_GETWORKAREA As Long = 48 Private Type RECT lLeft As Long lTop As Long lRight As Long lBottom As Long End Type Private Sub Form_Load() Dim deskRECT As RECT Call SystemParametersInfo(SPI_GETWORKAREA, 0&, deskRECT, 0&) With deskRECT Me.Move .lLeft * Screen.TwipsPerPixelX, _ .lTop * Screen.TwipsPerPixelX, _ (.lRight - .lLeft) * Screen.TwipsPerPixelX, _ (.lBottom - .lTop) * Screen.TwipsPerPixelX End With End Sub
Thanks a lot
Done
Great :thumb:
I see you've added the green tick, but if you go to thread tools just above your first post and click 'Mark Thread Resolved' then it makes it even clearer. Thanks.
I have a custom TitleBar with three buttons : minimize,Maximize and close.
For Maximize I used your code becuase I dont want my form to cover taskbar.
The question now is How to make a form normal?
Normal - when a user double clicks the TitleBar(windowState=VbNormal doesnt work)?
I have created a new thread for this, please answer me on that thread :
<URL>http://www.vbforums.com/showthread.php?p=4121865#post4121865</URL>
Thank you.