Jump to content

Welcome to Geeks to Go - Register now for FREE

Geeks To Go is a helpful hub, where thousands of volunteer geeks quickly serve friendly answers and support. Check out the forums and get free advice from the experts. Register now to gain access to all of our features, it's FREE and only takes one minute. Once registered and logged in, you will be able to create topics, post replies to existing threads, give reputation to your fellow members, get your own private messenger, post status updates, manage your profile and so much more.

Create Account How it Works
Photo

Form Help


  • Please log in to reply

#1
Granz00

Granz00

    Member

  • Member
  • PipPipPip
  • 226 posts
Basically, I had 4 forms that I went through. Starting on my Main form, I had a button to take me to a rental form, or one to take me to the buying form. To get rid of the first form, I hid it. Then each of the next two forms would go to the forth, and final form. On that form, I allowed them to close the program. However, closing the final form doesn't truly stop the program. I added an End statement to a closing subroutine for the final form, which fixed the problem for now.

So I am wondering if there is a way I can do a couple of things. First, after hiding the first form, how can I show the form again? Second, is there a way that after opening the first form, that I can just switch the control of the program to a new form, and dispose of the first form completely, rather then hiding it?

Attached is the program that I ran across this problem in.

Attached Files

  • Attached File  U5_3.zip   52.45KB   222 downloads

  • 0

Advertisements


#2
stettybet0

stettybet0

    Trusted Tech

  • Technician
  • 2,579 posts
To answer your questions...

1. To show the first form again after it is hidden, simply put Form1.Show() under whatever event you want the form to be shown.
2. You must first go to the Project menu, then select [project name] Properties. Under the Application tab, change the Shutdown mode to "When last form closes". (Note: If this option is grayed out, ensure that "Enable Application Framework" is checked.) Then put Me.Close() where ever you are using Me.Hide(), and the form will now close instead of hiding, without ending your whole program.

Lastly, just one thing I want to add. You should use Application.Exit() when you want to close your program. This will properly end the program no matter which forms are open or how many forms are open, without doing any of the above steps. :)

Also, are you sure you are using VB.NET 2008? When I tried to open your program, Visual Basic 2008 Express Edition detected it as an older version of VB.NET and made me convert it. It looks very VB.NET 2003 to me.
  • 0

#3
Granz00

Granz00

    Member

  • Topic Starter
  • Member
  • PipPipPip
  • 226 posts
Thanks for the reply. When I did this program, I guess I did it at work, which is using an older version. I tested it out on 2008 with this program, but I guess it didn't pop up that it was created in an older version for some reason.
  • 0






Similar Topics

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

As Featured On:

Microsoft Yahoo BBC MSN PC Magazine Washington Post HP