MDI Form & MsgBox Problem!!!

Nilhanth
02-01-2005, 12:58 PM
Ok, I have a main Parent MDI form, and an MDI child form within the main parent form. (It is maximised within the main parent)

HOWEVER, when a msgbox from the main parent form pops up, the child form disappears and I can't get it back unless I re-load it from my menu!

How can I make the child form stay visible whilst a MsgBox is displayed???

Any ideas?

Thanks In Advance!

NEOLLE
02-02-2005, 09:00 PM
Hi,
I tried loading a form (maximized) inside an MDI form and Triggerd a message box from the MDI form. There is no problem. No unloading of form happened.

My guess is that theres a bug in your code. :)

Nilhanth
02-03-2005, 09:54 AM
Hi,
I tried loading a form (maximized) inside an MDI form and Triggerd a message box from the MDI form. There is no problem. No unloading of form happened.

My guess is that theres a bug in your code. :)
Did you make the form an MDI Child?.......and it doesn't unload, it just disappears and for some reason I can't get it back until I refocus it

NEOLLE
02-03-2005, 07:46 PM
Did you make the form an MDI Child? - YES
.......and it doesn't unload - YES

Show us the code that calls the message box then. We'll try to fix things out. :)

Nilhanth
02-04-2005, 05:42 AM
Private Sub MDIForm_Unload(Cancel As Integer)
iResponce = MsgBox("You Haven't Saved Your Game Yet! Are You Sure You Want To Exit Without Saving?", vbYesNo, "You Haven't Saved Yet!")
If iResponce = vbYes Then
Unload Me
Else
Cancel = 1
End If
End Sub

As I click on the main MDI form's "X" button, the MDI child dissapears.......try that in your code and see if you get the same

NEOLLE
02-04-2005, 08:38 PM
I see you are creating a game, so place your unload questions in your Form_Unload form event not from your MDI_Unload.


Private Sub Form_Unload(Cancel As Integer)
If MsgBox(MsgBox("You Haven't Saved Your Game Yet! Are You Sure You Want To Exit Without Saving?", vbYesNo, "You Haven't Saved Yet!")
) = vbNo Then
Cancel = 1
Else
'-- I don't like End command, but it leaves us no choice.
'-- unload all necessary objects to unload
'-- set to nothing all necessary object to be set
End
End If
End Sub


Still Im not saying this is the only way. If there are means by not using the End command then its much better. :)

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum