Solved

Moving From One Form To Another During Runtime

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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

This article will show, step by step, how to integrate R code into a R Sweave document
This is about my first experience with programming Arduino.
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 fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

760 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

18 Experts available now in Live!

Get 1:1 Help Now