G
Guest
Hi,
I have a form (switchboard like form) thats loaded into a MDI parent form.
This form is the start off point for all the other screens in the app. I have
placed a exit button on the switchboard and would like to use it to close all
app down. What is the best way to do that? I have the following code but it
won't close the MDI parent form.
for each frm as Form in MdiParent.MdiChildren
frm.Close
Next
MdiParent.Close >> Errors on this line
I get the following error:
An unhandled exception of type 'System.NullReferenceException' occurred in
NF.exe
Additional information: Object reference not set to an instance of an object.
Now, it don't have a problem through the loop, but errors on the last line.
What variable name should I be using for the default startup form (in my case
the MDI Parent).
In the Upgrade Support region, there is a reference named
m_vb6FormDefInstance, but this variable won't work sith the for each loop, so
I'm stuck alittle. By the way, the way the code above is written, it does
close the child forms that are open, its just getting the parent to close.
Thanks for any advice.
Michael
I have a form (switchboard like form) thats loaded into a MDI parent form.
This form is the start off point for all the other screens in the app. I have
placed a exit button on the switchboard and would like to use it to close all
app down. What is the best way to do that? I have the following code but it
won't close the MDI parent form.
for each frm as Form in MdiParent.MdiChildren
frm.Close
Next
MdiParent.Close >> Errors on this line
I get the following error:
An unhandled exception of type 'System.NullReferenceException' occurred in
NF.exe
Additional information: Object reference not set to an instance of an object.
Now, it don't have a problem through the loop, but errors on the last line.
What variable name should I be using for the default startup form (in my case
the MDI Parent).
In the Upgrade Support region, there is a reference named
m_vb6FormDefInstance, but this variable won't work sith the for each loop, so
I'm stuck alittle. By the way, the way the code above is written, it does
close the child forms that are open, its just getting the parent to close.
Thanks for any advice.
Michael