|
-
Jan 24th, 2003, 12:31 PM
#1
Thread Starter
Hyperactive Member
Minimized Form *[RESOLVED]*
How do you check if a user has minimized a form?
VB Code:
Private Sub Form1_<whatever it is!>
Last edited by RealNickyDude; Jan 30th, 2003 at 08:56 AM.
-
Jan 24th, 2003, 01:26 PM
#2
Sleep mode
try this ...
VB Code:
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
-
Jan 24th, 2003, 01:32 PM
#3
Thread Starter
Hyperactive Member
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.
-
Jan 24th, 2003, 01:46 PM
#4
Sleep mode
Originally posted by pirate
try this ...
VB Code:
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)
-
Jan 24th, 2003, 01:58 PM
#5
Thread Starter
Hyperactive Member
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.
-
Jan 24th, 2003, 02:12 PM
#6
-
Jan 24th, 2003, 02:19 PM
#7
Thread Starter
Hyperactive Member
Novel way , but not quite what I had in mind.
-
Jan 29th, 2003, 02:18 PM
#8
Sleep mode
Back here ,
try this , it should work
VB Code:
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
-
Jan 30th, 2003, 08:55 AM
#9
Thread Starter
Hyperactive Member
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
|