AmitBAcharya
asked on
STOP CLOSING PARENT MDI FORM
Hi,
I have a winforms based MDI application.
When a user clicks on the close button on the Main MDI, amongst many open child forms, one of forms has a prompt for closure like
"Do you want to close this form?, OK / CANCEL"
Is it possible to stop the closing of the main MDI depending on the user's choice of closing the child form?
As of now, the application continues back to the main MDI execution and closes the main MDI, regardless of whether the user has clicked OK or CANCEL
If yes, would appreciate some sample code...
I have a winforms based MDI application.
When a user clicks on the close button on the Main MDI, amongst many open child forms, one of forms has a prompt for closure like
"Do you want to close this form?, OK / CANCEL"
Is it possible to stop the closing of the main MDI depending on the user's choice of closing the child form?
As of now, the application continues back to the main MDI execution and closes the main MDI, regardless of whether the user has clicked OK or CANCEL
If yes, would appreciate some sample code...
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I am not able to do that directly with the application architecture, as the parent form and child forms are in separate MS.NET solutions and referred in a complex hierarchy.
Is there a way to stop all processing upon clicking cancel while closing a child form. The control should not go back to the parent form.
Is there a way to stop all processing upon clicking cancel while closing a child form. The control should not go back to the parent form.
can you clarify your canse more. please... it is abit unclear and need details... as far as i understand to prevent the form from closing e.cancel=true will do so...and checking for the NO respond of messagebox it returns 7 as integer...
How are you showing the child form ?
Can you post the code
Can you post the code
then you have to show a messagebox with yesno buttons..
dim x as integer
x=MessageBox.Show("are you sure?","Confirm","sd",Syst
if x=6 then
else
e.cancel=true
end if