Solved

Moving From One Form To Another During Runtime

Posted on 2007-12-06
2
1,152 Views
Last Modified: 2013-11-26
Greetings Everyone.
I have this problem. I am developing a Windows Application with VB.NET, I have several forms, and what I need to do is allow the user to move from one form to another based on the "Button" Control he clicks on, so if he clicks on "btnAddCustomer" button the main window should disappear and the "frmAddNewCustomer" form should appear. the main window is called "frmMain", when I tried the following code, nothing happens, the debugger just exits without giving any error message:

me.close
frmAddNewCustomer.show

so I tried the following code:

me.close
frmAddNewCustomer.showDialog()

And I get the same results, the debugger just exits without giving any warning or error message.
I am kind of lost, I remember with VB6 I used to use the following code and used to work prefectly:

me.close
load frmCustomer
frmCustomer.show

so, would anyone have any clue how to tackle this problem?
Thanks in advance.

~Salman~


0
Comment
Question by:salman_sulaiman_2008
2 Comments
 
LVL 18

Accepted Solution

by:
jcoehoorn earned 500 total points
ID: 20422205
Look at the properties for the project ("My Project" in the solution explorer).  On the application tab is an option for "Shutdown mode:".  The default is "When the startup form closes".  Change it to "When the last form closes".
0
 

Author Comment

by:salman_sulaiman_2008
ID: 20422260
Greetings Icoehoorn!
that is just fantastic! it worked, but I had to modify the code, now I just use the following:

me.hide
frmAddNewCustomer.show

and I tried the same for the third form, I hide the second one and display the third one, it is just fantastic, it works nicely and smoothly. Thanks mate!

~Salman~
0

Featured Post

Webinar: Aligning, Automating, Winning

Join Dan Russo, Senior Manager of Operations Intelligence, for an in-depth discussion on how Dealertrack, leading provider of integrated digital solutions for the automotive industry, transformed their DevOps processes to increase collaboration and move with greater velocity.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
If you’re thinking to yourself “That description sounds a lot like two people doing the work that one could accomplish,” you’re not alone.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…

860 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question