Hey I'm new to programming and to the forum. I am creating a simple inventory system that uses both modal and non-modal forms. My challenge is I created a change password form (modal) and it has a 'change password' button as well as a 'cancel' button. When i click cancel, it closes everything. I dont want that I only want the change password form to close leaving the parent form in view. I have search high and low but the help that I got (this.close, dispose) does not work. I even changed the dialogResult property to cancel but that didnt work either. How do I accomplish this?

Edited 3 Years Ago by JesGo

I tried that but it didnt really hide it was still there its just that you cannot interface with it because of how modal forms operate. I want it to be removed from view totally and should only be seen if I bring it back. Any other suggestions?

When you Hide the form it is no longer visible. I have no idea what you think you are doing, but it isn't calling Hide on the form.

I'm thinking that perhaps you're coding and the set up of your properties might be out. With accept and cancel assigned on the modal form and this.Close(); in the click event of the cancel button, just the modal form closes, not the parent. when testing this I also set the isMDIParent to true on the parent form.

@samsylvestertty, no its not. The MDI thing was giving me some problems in order to do what I wanted so thats how I used modal forms. If I set the parent form to MDI, it will mess up the design.

I tried to reproduce the problem you posted but couldn't. This link seems to be identical to your problem. Check that....

Edited 3 Years Ago by samsylvestertty

This article has been dead for over six months. Start a new discussion instead.