I have a MDI Parent form...
Now .. for the close button ( X ) on top right i have the code
vb Code:
Private Sub MDIForm_QueryUnload(Cancel As Integer, UnloadMode As Integer) Dim vbResponse As VbMsgBoxResult vbResponse = MsgBox("Are You Sure You want to exit the Program?", vbYesNo, " Exit Application") Select Case vbResponse Case vbYes Unload Me Case vbNo Cancel = -1 End Select End Sub
as suggested by some1..
and I have a EXIT coded in the menu.. the code is
vb Code:
Private Sub mnuexit_Click() msg = MsgBox("Are You Sure You want to exit the Program?", vbYesNo, " Exit Application") If msg = vbYes Then Unload Me Else Exit Sub End If End Sub
Now the problem is.. that when i click on the close button.. its works fine..
But when I click on the the EXIT MENU.. then it 1st runs its msgbox.. then runs the CLOSE BUTTON code??? I dont know why.. so the msgbox pop ups twice on the EXIT MENU
Please help here.. I dont want the box to come twice asking again to exit or not..




Reply With Quote