borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2007 Andrea Tincaniborder

AndreaVB | Forum | News | Downloads | Register | Help | Member List | Statistics | Search | PM | Profile

Print This Topic
Previous Topic (QUICK! how to c what parameters were passed to my app?)Next Topic (edge and width detection) New Topic New Poll Post Reply
AndreaVB Forum : VB General : Mdi minimize,maximize
Poster Message
vbLearner
Level: Graduate

Registered: 21-04-2006
Posts: 13

icon Mdi minimize,maximize

Hi

Please help how to do this...


If my mdi form are in minimize mode

        do this at the same time...(show statusbar)

elseif my form are maximize/restore

          do this at the same time....(hide statusbar)
endif


anybody can help me


thanks in advance
-----------------------
vblearner

30-06-2006 at 07:24 AM
View Profile Send Email to User Show All Posts | Quote Reply
steve_w
Level: Moderator


Registered: 18-04-2003
Posts: 1156
icon Re: Mdi minimize,maximize

Hi vbLearner

You need to put some code into your mdi form resize event, see my example below.

Private Sub MDIForm_Resize()

On Error Resume Next

    Select Case Me.WindowState
    
        ' not sure about point of this one
        ' cos if its minimized you won't
        ' see it anyway
        Case vbMinimized
        
            StatusBar1.Visible = True
            
        Case vbNormal
        
            StatusBar1.Visible = True
            
        Case vbMaximized
        
            StatusBar1.Visible = False
            
    End Select

End Sub



Hope it helps

Steve

30-06-2006 at 11:24 AM
View Profile Send Email to User Show All Posts | Quote Reply
yronium
Level: Moderator


Registered: 14-04-2002
Posts: 907
icon Re: Mdi minimize,maximize

quote:
steve_w wrote:
Private Sub MDIForm_Resize()

On Error Resume Next

    Select Case Me.WindowState
    
        ' not sure about point of this one
        ' cos if its minimized you won't
        ' see it anyway
        Case vbMinimized
        
            StatusBar1.Visible = True
            
        Case vbNormal
        
            StatusBar1.Visible = True
            
        Case vbMaximized
        
            StatusBar1.Visible = False
            
    End Select

End Sub

Excuse me, steve, but I wonder why someone should hide a statusbar when the form is maximized, and show it in the other cases, when there is less room or no room to show it. Anyway, I'd write it like following
Private Sub MDIForm_Resize()
On Error Resume Next
    StatusBar1.Visible = Not (Me.WindowState = vbMaximized)
End Sub


Hope it helps

[Edited by yronium on 30-06-2006 at 01:09 PM GMT]

____________________________
Real Programmer can count up to 1024 on his fingers
30-06-2006 at 12:07 PM
View Profile Send Email to User Show All Posts | Quote Reply
AndreaVB Forum : VB General : Mdi minimize,maximize
Previous Topic (QUICK! how to c what parameters were passed to my app?)Next Topic (edge and width detection) New Topic New Poll Post Reply
Surf To:


Not Logged In? Username: Password: Lost your password?
Partners: Download Actual Software | Free Software Download
borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2007 Andrea Tincaniborder