Solved

Moving From One Form To Another During Runtime

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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
Entering a date in Microsoft Access can be tricky. A typo can cause month and day to be shuffled, entering the day only causes an error, as does entering, say, day 31 in June. This article shows how an inputmask supported by code can help the user a…
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 …
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

911 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now