|
-
Mar 21st, 2006, 05:00 AM
#1
Thread Starter
Lively Member
Questiong about WindowState
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
Last edited by clear_zero; Mar 21st, 2006 at 10:19 AM.
-
Mar 21st, 2006, 07:11 AM
#2
Re: Questiong about WindowState
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
-
Mar 21st, 2006, 10:18 AM
#3
Thread Starter
Lively Member
Re: Questiong about WindowState
-
Mar 21st, 2006, 10:23 AM
#4
Re: Questiong about WindowState
Great 
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.
-
Jan 22nd, 2012, 10:00 AM
#5
Junior Member
Re: Questiong about WindowState
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.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|