This would be very useful to know.
Any suggestion?
SeaHag
This would be very useful to know.
Any suggestion?
SeaHag
VB Code:
Private Sub Form_Unload(Cancel As Integer) Cancel = -1 Form1.WindowState = vbMinimized End Sub
Cool thanks..
Could you tell me how that works?
Why -1?
:cool:
-1 is True in VB so it tells the Form Unload to Cancel itself.
Sorry guys, won't trapping & re-directing the Unload event of the form prevent it from unloading Ever Ever Ever ??
Pee:confused:
you can still end the program usind end and set form1 = nothing elsewhere
I have a menu system.. seems to exit (end) alright :)
I'm not causing problems here honest...
but wot if you did'nt want to End the Prog ? Just unload the Form ?? I suppose it can stay Minimised allright, not much overhead...
I have the program in the task bar.
so I dont want people to Exit.
:)
minimized property forces the program to the taskbar
Ah yeah, Ok, I was just thinking out-loud really, in a different situation, trapping the Last event of the form could potentially cause infinite looping unless you Ended. Sorry for the annoyance.
Pee
Np!! :cool:
I like ideas!
You should use the QueryUnload event instead of the Unload event.This will allow the form to be unloaded using the Unload FormName statement and also allowing Windows to terminate the application if someone closes Windows without first closing the application.VB Code:
Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer) If UnloadMode = vbFormControlMenu Then Cancel = True Me.WindowState = vbMinimized End If End Sub
Ok. Makes sense..
Thanks! all