Log inUsernamePassword
Log me on automatically each visit    
Register
Register
Log in to check your private messages
Log in to check your private messages
Visual Basic Forum for Visual Basic Programmers VB Forum Index » Interface and Graphics

Post new topic   Reply to topic
Maximized screen
View previous topic :: View next topic  
Author Message
Mitesh2004
Freshman


Joined: 26 Jan 2004
Posts: 43

PostPosted: Mar 16th, 2004 01:22 PM    Post subject: Maximized screen Reply with quote

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
View user's profile Send private message Send e-mail
P.T.A.M.
Administrator


Joined: 08 Oct 2003
Posts: 752
Location: Greece

PostPosted: Mar 17th, 2004 09:07 AM    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website ICQ Number
Mitesh2004
Freshman


Joined: 26 Jan 2004
Posts: 43

PostPosted: Mar 17th, 2004 09:25 AM    Post subject: Reply with quote

No, it still doesnt come on top of the Startbar. It comes in front of all the other windows, just not the startbar! >Sad

Any other ideas?
Back to top
View user's profile Send private message Send e-mail
P.T.A.M.
Administrator


Joined: 08 Oct 2003
Posts: 752
Location: Greece

PostPosted: Mar 17th, 2004 10:10 AM    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website ICQ Number
Mitesh2004
Freshman


Joined: 26 Jan 2004
Posts: 43

PostPosted: Mar 17th, 2004 11:00 AM    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
Mitesh2004
Freshman


Joined: 26 Jan 2004
Posts: 43

PostPosted: Mar 17th, 2004 11:23 AM    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    Visual Basic Forum for Visual Basic Programmers VB Forum Index » Interface and Graphics All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
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


Visual Basic Forum runs phpBB | Forum Template © iOptional
VB Resources | SSL | Visual Basic