Close the windows form if its instance is running.
I have three forms
1) Normal Windows Forms (Named Main Screen)
2) MDI form (Named POS)
3) MDI form (Named Stock)
When I click Button on [Main Screen]
I am opening a
MDIPOS FORM
from
[Main Screen]
by button click event. The code is:
MDIPOS pos=new MDIPOS();
pos.MdiParent = this;
pos.Activate();
pos.Show();
Getting Problem in Closing the form.
When I close the
MDI Form
or
Main Screen Form
one its instance remain running.
I used :
frmMain.Dispose();
frmMain.Close();
Then also it instance remain running.
If I use only one form, it closes perfectly.
How to close the instance of another form.
because, to access a form, we need to create a new object of that form and that that new object is destroyed , but what about the previous one which was opened.
I hope I explain the problem nicely.
Appreciate your best reply
Thanking You