Question Opening Childform creates new instance of ParentForm

deanobravo

Member
Joined
Dec 31, 2011
Messages
9
Location
Christchurch, New Zealand
Programming Experience
10+
Hi,
I am very new to VB.net (like 2 days in) and am in the process of upgrading a VB6 Project to Vb.net.
My problem is that when I open a child form in my project from within the Parent form a new instance of the Parent form is created.
The code is fairly simple:

frmnewContract.MdiParent = Me
frmnewContract.Show()

Any help appreciated.
Thanks.
 
I think I may have found a partial answer to this. My program started through Sub Main, I have now amended it to start via the Login Screen which has allowed me to select "make single instance application" as part of my Application's Properties. This has resolved the problem, however, I would still like to know why this was happening purely for my own edification. I created a small test application with a couple of forms and a sub main and I couldn't get it to replicate the re-instancing.
 
Back
Top