Solved

Moving From One Form To Another During Runtime

Posted on 2007-12-06
2
1,151 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

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Footer for each row on Gridview 2 21
VB.NET 2008 - SQL Timeout 9 24
Convert datetime to time string 10 21
Complex SQL statement in VB.NET 7 15
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
Computer science students often experience many of the same frustrations when going through their engineering courses. This article presents seven tips I found useful when completing a bachelors and masters degree in computing which I believe may he…
An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …
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…

810 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