Jump to content
Xtreme .Net Talk

Recommended Posts

Posted
Cant really undestand what your trying to do, you want to close one form and open another, thats relatively simple: just declare an instance of the new form to open and form.show() it, then me.close the calling form (as long as it isnt the parent in an mdi interface - otherwise you will exit out your entire application!)

Visit: VBSourceSeek - The VB.NET sourcecode library

 

 

"A mere friend will agree with you, but a real friend will argue."
Posted

I see what you mean now, like in the setup wizards you get with applications. Well, 1 way i would do this would be to have 1 form with multiple panels, each panel contains the controls i need visible at any one time, and when pressing next just hide the currently visible panel, and show the next one.

 

Or alternatively just open the new form, and close the current one:

'Replace FormToOpenName with the actual name of the form you want to open
Dim frmToOpen As New FormToOpenName
frmToOpen.show()

'Close the current form
Me.close

 

I havent tested the above, but im sure u get the idea

Visit: VBSourceSeek - The VB.NET sourcecode library

 

 

"A mere friend will agree with you, but a real friend will argue."
  • 6 months later...
Posted

me.close will close all forms only when calling that from the form that starts-up when the application starts. That can be changed by creating a Sub Main and starting from there.

 

**edit**

Crap sorry was not looking at how old the post was, was looking for something else and had a brain meltdown.

"Nobody knows what I do until I stop doing it."
Posted

Old post but still worth errors correction...

 

Rick_Fla: Your way will also end the application.

Any windows Application needs a form to sustain the message loop (what keeps the application alive). So, even if this form is startes on a Sub Main, calling Application.Run or ShowDialog, if you lose it, the application will end...

 

What you can do is to change the application base form and then you can close the primerelly opened form.

 

Take a look at my post on this thread: http://www.xtremedotnettalk.com/showthread.php?t=85196&highlight=applicationcontext

(it's the last one) it will show you how to do this...

 

Alex :p

Software bugs are impossible to detect by anybody except the end user.

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...