Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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

  • *Experts*
Posted

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.

Posted

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.

  • *Experts*
Posted

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.

  • 2 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...