Solved

Moving From One Form To Another During Runtime

Posted on 2007-12-06
2
1,153 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

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…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
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 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 …

740 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