|
-
Oct 15th, 2003, 02:25 PM
#1
Thread Starter
Lively Member
Multiple instances of a form
OK, I don't get it.
I have a main form which is originally loaded via a subMain using Application.Run(New frmMain()) at the start of my app. Button1 on frmMain opens a second form(Form4). On a click event of Form4 I need to close Form4 and go back to frmMain. Currently on the click event of Form4 another instance of frmMain opens because I also placed:
Dim frmMain As New frmMain()
frmMain.Show()
in the click event. I know that's not right & it causes my problem, but how do I get around this? How do I bring up only one instance of frmMain?
Thanks
-
Oct 15th, 2003, 03:46 PM
#2
Lively Member
-
Oct 15th, 2003, 03:48 PM
#3
Thread Starter
Lively Member
-
Oct 15th, 2003, 03:52 PM
#4
Addicted Member
i dont understand if all you want to do is close the form, i think writing
in the click event will do it, why are adding
Code:
Dim frmMain As New frmMain()
frmMain.Show()
if you just want to close it?!!!
sorry if i understood your Q wrong ...
-
Oct 15th, 2003, 04:11 PM
#5
I think persianboy is right, if you close the current form then focus should automatically go back to the previous form. I mean you never closed the main form right? So it'll still be there.
-
Oct 16th, 2003, 08:13 AM
#6
Thread Starter
Lively Member
Thanks persianboy & Edneeis, Thats what I needed to do. I guess that with learning .Net & knowing that simple things are different I sometimes make things harder than they should be.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|