Guest mutant Posted February 26, 2003 Posted February 26, 2003 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. Quote
billy_bob169 Posted February 26, 2003 Posted February 26, 2003 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. Quote I'd rather be riding than working
Guest mutant Posted February 26, 2003 Posted February 26, 2003 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. Quote
gates150 Posted February 26, 2003 Posted February 26, 2003 (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 February 26, 2003 by gates150 Quote
Guest mutant Posted February 26, 2003 Posted February 26, 2003 :) I was trying it too. Man who thought of not letting main form close cause child form wont close... MS is smart (:( ) Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.