 |
| View previous topic :: View next topic |
| Author |
Message |
Mitesh2004 Freshman
Joined: 26 Jan 2004 Posts: 43
|
Posted: Mar 16th, 2004 01:22 PM Post subject: Maximized screen |
|
|
Hello,
In my program, i want the initial form to be maximized and cover the whole screen. At the moment, it is not covering the Windoes Start bar at the bottom of the screen (the form is falling behind it). How do i make it cover the whole screen?
If this is not possible, how do i get it so that the form is maximised but not underneath the start bar. At the moment, the bootom of the form is being covered by the start bar.... how do i get it so that the bootom of the form is above the top of the start bar? |
|
| Back to top |
|
P.T.A.M. Administrator

Joined: 08 Oct 2003 Posts: 752 Location: Greece
|
Posted: Mar 17th, 2004 09:07 AM Post subject: |
|
|
Maybe if you set the form as "always on top" :
[vb:1:9b2bac7cfa]Option Explicit
Private Declare Function SetWindowPos Lib "user32" (ByVal hwnd As Long, ByVal hWndInsertAfter As Long, ByVal x As Long, ByVal y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long
Public Sub AlwaysOnTop(Frm As Form, Enabled As Boolean)
Const SWP_NOMOVE = 2
Const SWP_NOSIZE = 1
Const HWND_TOPMOST = -1
Const HWND_NOTOPMOST = -2
If Enabled Then
SetWindowPos Frm.hwnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE Or SWP_NOSIZE
Else
SetWindowPos Frm.hwnd, HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOMOVE Or SWP_NOSIZE
End If
End Sub
Private Sub Command1_Click()
AlwaysOnTop Me, True
End Sub
Private Sub Command2_Click()
AlwaysOnTop Me, False
End Sub
Private Sub Form_Load()
Command1.Caption = "yes"
Command2.Caption = "no"
End Sub[/vb:1:9b2bac7cfa] _________________ No one is completely useless. They can at least be an example of what to avoid. |
|
| Back to top |
|
Mitesh2004 Freshman
Joined: 26 Jan 2004 Posts: 43
|
Posted: Mar 17th, 2004 09:25 AM Post subject: |
|
|
No, it still doesnt come on top of the Startbar. It comes in front of all the other windows, just not the startbar! >
Any other ideas? |
|
| Back to top |
|
P.T.A.M. Administrator

Joined: 08 Oct 2003 Posts: 752 Location: Greece
|
Posted: Mar 17th, 2004 10:10 AM Post subject: |
|
|
It does for me... Are you sure? You used this in the form_load ( AlwaysOnTop Me, True) and it still didn't work? What OS do you have? :ermm: _________________ No one is completely useless. They can at least be an example of what to avoid. |
|
| Back to top |
|
Mitesh2004 Freshman
Joined: 26 Jan 2004 Posts: 43
|
Posted: Mar 17th, 2004 11:00 AM Post subject: |
|
|
Yes, i am sure that it doesnt work for me. Could i have any of the settings different?
I am using Windows 98 |
|
| Back to top |
|
Mitesh2004 Freshman
Joined: 26 Jan 2004 Posts: 43
|
Posted: Mar 17th, 2004 11:23 AM Post subject: |
|
|
| Dont worry, i found out what the problem was. I had set the MaxButton property of the form to True. When i set it to False, The form no longer fell behind the startbar |
|
| Back to top |
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|