Click to See Complete Forum and Search --> : Minimized Form *[RESOLVED]*
RealNickyDude
Jan 24th, 2003, 11:31 AM
How do you check if a user has minimized a form?
Private Sub Form1_<whatever it is!>
Pirate
Jan 24th, 2003, 12:26 PM
try this ...
Private Sub Form1_Resize(ByVal sender As Object, ByVal e _
As System.EventArgs) Handles MyBase.Resize
If Not FormWindowState.Minimized = True Then
MsgBox("Minimized")
End If
End Sub
RealNickyDude
Jan 24th, 2003, 12:32 PM
All I get is the message box saying "Minimized", I click ok to get rid of it, and back it comes, I had to shut the program down using the Task Manager!
(I Build the Solution and run it from a shortcut on my TaskBar, I don't run it from within VB).
I have the WindowState as Maximized, perhaps that's causing the problem.
Pirate
Jan 24th, 2003, 12:46 PM
Originally posted by pirate
try this ...
Private Sub Form1_Resize(ByVal sender As Object, ByVal e _
As System.EventArgs) Handles MyBase.Resize
If Not FormWindowState.Minimized = True Then
MsgBox("Minimized")
End If
End Sub
Did you try the code without "Not" ?
this won't work either . try with other size events (changesize and maximizedchange (I think)
RealNickyDude
Jan 24th, 2003, 12:58 PM
yeah, I tried that after I posted the message, seemed more logical without the not but then I got no message.
Perhaps the problem is that i'm not actually resizing the Form, just minimizing (although you'd think that minimizing would call the Resize).
I've tried different things but I'm stuck. :(
Pirate
Jan 24th, 2003, 01:12 PM
I know this isn't solution but it might be ......one of the available till now :D , Cute UI. (I like when I draw my style on my app.)
RealNickyDude
Jan 24th, 2003, 01:19 PM
Novel way :D , but not quite what I had in mind.
Pirate
Jan 29th, 2003, 01:18 PM
Back here :D ,
try this , it should work
Private Sub Form1_Resize(ByVal sender As Object, ByVal e _
As System.EventArgs) Handles MyBase.Resize
Select Case Me.WindowState
Case FormWindowState.Minimized
'MsgBox("Minimized")
Case FormWindowState.Maximized
MsgBox("Maximized")
Case FormWindowState.Normal
'MsgBox("Normal")
End Select
End Sub
RealNickyDude
Jan 30th, 2003, 07:55 AM
Thanks Pirate!
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.