child form problem

ckbseng

Member
Joined
Sep 18, 2008
Messages
15
Programming Experience
3-5
i MDI form there, i was create the children form within a same MDI form
every time i click on the button to show the form, which means i create a new form, how i do for ensure that each time i click on the button there will not create a new form is the form is really exist? how to avoid duplicate of the form will not exist twice?

another 1 more question is also about the MDI form, everytime i create i new form, the new form is covered by old form, how i do that the new form i created will always show infront, other 1 will show at behide
 
i MDI form there, i was create the children form within a same MDI form
every time i click on the button to show the form, which means i create a new form, how i do for ensure that each time i click on the button there will not create a new form is the form is really exist? how to avoid duplicate of the form will not exist twice?
Hmm.. My suggestion is create the new form of mdi child at MdiFormLoad,
then at the button to show the form, u can just put syntax to show that form.
I hope it help, I'm just newbie too.

Regards,
 
VB.NET:
        For Each ExsistingChildForm As Form In Me.MdiChildren
            If ExsistingChildForm.Name = YourNewForm.Name Then
                ' Child form already exists
                ' Do something here
                Exit For
            End If
        Next
 
Use the default form instance instead of creating any instances of the form yourself. You qualify the default instance simply with the form name; for example OptionsForm.Show().
 
Back
Top