woklet Posted June 21, 2005 Posted June 21, 2005 From my main form, in a combo box, I call a second form like this: dim NewForm as form2 NewForm = new form2 NewForm.show After the user completes their work in form2, I need to get back to form1. How can I do this? If I do this from form2... dim OrigForm as form1 OrigForm = form1 form1.show ...it creates another instance of form1. I need to get back to my original form1. How can I go back and forth from one form to another without re-creating them each time? Thanks in advance Ben Quote
lothos12345 Posted June 21, 2005 Posted June 21, 2005 Answer I think If form1 is your startup form it should still be open. All you should have to do is close form2 and the program should refocus on form1 you do not need to add any additional code. Quote
Administrators PlausiblyDamp Posted June 21, 2005 Administrators Posted June 21, 2005 http://www.xtremedotnettalk.com/showthread.php?t=83092 may be worth a quick read. Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
jmcilhinney Posted June 21, 2005 Posted June 21, 2005 I could be wrong, but from the little you've said I would guess that you want a modal dialogue, i.e. a dialogue that prevents access to its opener until you dismiss it, like a MessageBox. If I am correct, you should display your form by calling ShowDialog instead of Show. ShowDialog does not return until the new window is closed, at which point it returns the value of the form's DialogResult property, which is supposed to indicate what button was used to dismiss the form, once again like a MessageBox. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.