|
-
Feb 2nd, 2014, 10:39 AM
#1
Thread Starter
PowerPoster
[RESOLVED] form to fill the screen,but not cover the taskbar
I have a form I want to fill the whole screen, but not cover the taskbar.
I realize the taskbar could be on the top, bottom or sides.
How to write this ?
Waiting for a full featured smart phone with out marrying a provider
Go Android
Go raiders 
-
Feb 2nd, 2014, 10:45 AM
#2
Re: form to fill the screen,but not cover the taskbar
does this work?
Me.Move 0, 0, Screen.Width, Screen.Height
-
Feb 2nd, 2014, 10:59 AM
#3
Thread Starter
PowerPoster
Re: form to fill the screen,but not cover the taskbar
 Originally Posted by MarkT
does this work?
Me.Move 0, 0, Screen.Width, Screen.Height
Thanks but no it still covers the taskbar
Waiting for a full featured smart phone with out marrying a provider
Go Android
Go raiders 
-
Feb 2nd, 2014, 11:09 AM
#4
Re: form to fill the screen,but not cover the taskbar
What about
Me.WindowState = vbMaximized
-
Feb 2nd, 2014, 11:13 AM
#5
Fanatic Member
Re: form to fill the screen,but not cover the taskbar
Use a WindowState of 0 (Normal)
Code:
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Private Declare Function GetWindow Lib "user32" (ByVal hWnd As Long, ByVal wCmd As Long) As Long
Private Declare Function GetWindowRect Lib "user32" (ByVal hWnd As Long, lpRect As RECT) As Long
Private Type RECT
Left As Long
Top As Long
Right As Long
Bottom As Long
End Type
Private Sub Form_Load()
Dim r As RECT
Dim hWnd As Long
hWnd = FindWindow("Shell_traywnd", vbNullString)
GetWindowRect hWnd, r
Me.Height = Screen.Height - ((r.Bottom - r.Top) * Screen.TwipsPerPixelX)
Me.Width = Screen.Width
End Sub
-
Feb 2nd, 2014, 11:18 AM
#6
Thread Starter
PowerPoster
Re: form to fill the screen,but not cover the taskbar
Already tried that, but it still covers the taskbar
Waiting for a full featured smart phone with out marrying a provider
Go Android
Go raiders 
-
Feb 2nd, 2014, 11:23 AM
#7
Fanatic Member
Re: form to fill the screen,but not cover the taskbar
 Originally Posted by isnoend07
Already tried that, but it still covers the taskbar
Screenshot of the above code
-
Feb 2nd, 2014, 11:31 AM
#8
Thread Starter
PowerPoster
Re: form to fill the screen,but not cover the taskbar
 Originally Posted by janu
Use a WindowState of 0 (Normal)
Code:
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Private Declare Function GetWindow Lib "user32" (ByVal hWnd As Long, ByVal wCmd As Long) As Long
Private Declare Function GetWindowRect Lib "user32" (ByVal hWnd As Long, lpRect As RECT) As Long
Private Type RECT
Left As Long
Top As Long
Right As Long
Bottom As Long
End Type
Private Sub Form_Load()
Dim r As RECT
Dim hWnd As Long
hWnd = FindWindow("Shell_traywnd", vbNullString)
GetWindowRect hWnd, r
Me.Height = Screen.Height - ((r.Bottom - r.Top) * Screen.TwipsPerPixelX)
Me.Width = Screen.Width
End Sub
thanks that seems to work when
adding this:
Private Sub Form_Load()
Me.Left = 0
Me.Top = 0
Dim r As RECT
Dim hWnd As Long
hWnd = FindWindow("Shell_traywnd", vbNullString)
GetWindowRect hWnd, r
Me.Height = Screen.Height - ((r.Bottom - r.Top) * Screen.TwipsPerPixelX)
Me.Width = Screen.Width
setting the left and top
Waiting for a full featured smart phone with out marrying a provider
Go Android
Go raiders 
-
Feb 2nd, 2014, 12:13 PM
#9
Re: [RESOLVED] form to fill the screen,but not cover the taskbar
It may work for you but it doesn't work for me
Me.WindowState = vbMaximized
and Taskbar set to no Auto Hide and keep Taskbar on top of other windows works best for me
Anything I post is an example only and is not intended to be the only solution, the total solution nor the final solution to your request nor do I claim that it is. If you find it useful then it is entirely up to you to make whatever changes necessary you feel are adequate for your purposes.
-
Feb 2nd, 2014, 12:17 PM
#10
Thread Starter
PowerPoster
Re: [RESOLVED] form to fill the screen,but not cover the taskbar
 Originally Posted by jmsrickland
It may work for you but it doesn't work for me
Me.WindowState = vbMaximized
and Taskbar set to no Auto Hide and keep Taskbar on top of other windows works best for me
I think that may work on win7, but not xp
Waiting for a full featured smart phone with out marrying a provider
Go Android
Go raiders 
-
Feb 2nd, 2014, 01:45 PM
#11
Re: [RESOLVED] form to fill the screen,but not cover the taskbar
 Originally Posted by isnoend07
I have a form I want to fill the whole screen, but not cover the taskbar.
I realize the taskbar could be on the top, bottom or sides.
How to write this ?
I believe the code here is what you're after.
On Local Error Resume Next: If Not Empty Is Nothing Then Do While Null: ReDim i(True To False) As Currency: Loop: Else Debug.Assert CCur(CLng(CInt(CBool(False Imp True Xor False Eqv True)))): Stop: On Local Error GoTo 0
Declare Sub CrashVB Lib "msvbvm60" (Optional DontPassMe As Any)
-
Feb 2nd, 2014, 02:18 PM
#12
Re: [RESOLVED] form to fill the screen,but not cover the taskbar
I don't see what that does any better than using vbMaximized. On my PC the results are exactly the same.
Anything I post is an example only and is not intended to be the only solution, the total solution nor the final solution to your request nor do I claim that it is. If you find it useful then it is entirely up to you to make whatever changes necessary you feel are adequate for your purposes.
-
Feb 2nd, 2014, 02:42 PM
#13
Re: [RESOLVED] form to fill the screen,but not cover the taskbar
 Originally Posted by jmsrickland
I don't see what that does any better than using vbMaximized. On my PC the results are exactly the same.
Based on isnoend07's OP and subsequent responses, I get the impression that maximizing the Form isn't the effect he's looking for. At any rate, it seems the OP has already found a suitable solution in post #8.
On Local Error Resume Next: If Not Empty Is Nothing Then Do While Null: ReDim i(True To False) As Currency: Loop: Else Debug.Assert CCur(CLng(CInt(CBool(False Imp True Xor False Eqv True)))): Stop: On Local Error GoTo 0
Declare Sub CrashVB Lib "msvbvm60" (Optional DontPassMe As Any)
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
|