Jump to content
Xtreme .Net Talk

problem with closing parent of mdi child


Recommended Posts

Posted

Hi.

I have a MDI child form, in closing handler i have:

Private Sub frmForm_Closing(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles MyBase.Closing
e.Cancel = True
End Sub

I dont want the user to be able to close the mdi child by clicking x cause its vital to my app. When i do that i cant close mdi parent either. Can anyone point me to some soultion?

Thanks.

Posted
Can you add a button on the child form, that simply does: "Me.Hide()"....I don't totally understand what you are trying to accomplish, but maybe this will do it? It will keep the form from closing, but get you back to the parent form to close it.
I'd rather be riding than working
Posted

Thats the problem, the mdi child is supposed to be empty, without any controls. When i press the x button on the right upper side of the child i dont want it to close, but when i click the x button on parent i want to close it. It wont let me do this.

I cant have a button cause i need the child empty.

Posted (edited)
Try setting the Forms ControlBox Property to False. This way the form will not show an X close box, and can't be closed using CTRL-F4. Remove the e.Cancel = True from the closing sub. Edited by gates150
Posted

:) I was trying it too.

Man who thought of not letting main form close cause child form wont close... MS is smart (:( )

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...