mdi cannot be displayed modally, therefore when in form1 you put the code
form2.Show
after form2 is loaded the flow of execution goes right back to the line following form2.Show
If you want to stop the execution after that line, you have to put that line exactly at the end of the event used to trigger show2, or put an exit sub just after.
form1.Show
exit sub
I form1 is not used anymore, put an unload me before exit sub. If you need to go back to form1 when form2 is done, add a public event to Form2. When form2 unloads (or whenever you want) raise that event. In form1 declare form2 as
Private withevents m_form2 as Form2
and restart the execution in form1 when that event is received.
And said that, if I were you I will create form2 and not an mdi, and display it modally.
Marco
|