Link to home
Start Free TrialLog in
Avatar of mmalwan
mmalwan

asked on

MDI FORM closing problem

Hi all
i am programming a simple application using vbasic, i have a MDIForm and 2 other child form of this MDI. When i start the mdi form i open the 2 other child. In the Unload event of the MDI Form i want to ask the user if he is sure he wants to exit but what happen is that the 2 child forms are closed before the msgbox appear.
Any help please
MMalwan
ASKER CERTIFIED SOLUTION
Avatar of Cimperiali
Cimperiali
Flag of Italy image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Piter
Piter

Use "Exit" Menu in MDI Form and
in code side

Private Sub exit_Click()
On Error Resume Next
Unload ActiveForm

dim i as integer
 i = Msgbox("Are you sure you want to exit",vbYesNo)
 if i = 6 then
  unload me
 end if
End Sub
Avatar of mmalwan

ASKER

thanks all
this is what i want
MMAlwan