GamesRule Posted December 30, 2003 Posted December 30, 2003 Hey New to .Net form just VB. Its pretty annoying switching but hey. Trying to switch between forms. Code is down below but the frmMain doesnt unload? Private Sub lblCustomers_LinkClicked(ByVal sender As System.Object, ByVal e As System.Windows.Forms.LinkLabelLinkClickedEventArgs) Handles lblCustomers.LinkClicked Dim frmCustomers As New frmCustomers Dim frmMain As New frmMain frmCustomers.Show() frmMain.Close() End Sub Quote
*Experts* mutant Posted December 30, 2003 *Experts* Posted December 30, 2003 Is the frmMain a form that is currently open and you wish to close it? Your current code creates a new instance of the frmMain form, so no other form will be affected by you calling the Close method on the form, but that instance. Quote
GamesRule Posted December 30, 2003 Author Posted December 30, 2003 Yeah frmMain is a form. I want frmCustomers to show when the label is clicked, that works. Then trying to unload frmMain doesnt work. All i want it to do is to unload that form. Tried Close() but that unloads everything. Quote
*Experts* mutant Posted December 30, 2003 *Experts* Posted December 30, 2003 Creating a new instance like you are doing in your code won't work as I said before. So you tried Me.Close() right? If the form you are closing is the application startup form then closing it will exit the application loop, and if the application loop is exited so is the application. You could Hide() the from instead of closing it. Quote
fcoreyesv Posted January 9, 2004 Posted January 9, 2004 Before you show the new form, you can close the actual (active) form this way. frmmain.activeform.close() cheers Jose Reyes Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.