when you hit the X button on the very top right, next to the minimize button i need the program to end.
i know i did this the completly wrong but heres my rig so far.
IF form1.Visable = FALSE THEN
END
and it only works sometimes LOL!
please help
Printable View
when you hit the X button on the very top right, next to the minimize button i need the program to end.
i know i did this the completly wrong but heres my rig so far.
IF form1.Visable = FALSE THEN
END
and it only works sometimes LOL!
please help
Never use End.VB Code:
Private Sub Form_Unload(Cancel As Integer) Dim frm As Form For Each frm in Forms If Not frm Is Me Then Unload frm Next frm End Sub
I dont quite understand what that code does.
i have a multi form project, but form1 is the main form, i dont mind if all other forms close with formX.Visable = false. but i need the entire program to shutdown and close when i hit the X button in the (main) form1.
thanks though
That code goes in the main form, so when you unload the main form it loops through all the currently open forms and tells them to unload.