Results 1 to 6 of 6

Thread: form1.show / form1.hide

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Sep 2000
    Location
    Atlanta
    Posts
    104

    Question

    I'm confused about the form1.show and form1.hide.

    Example:
    On Form1 there is one button and a textbox (Form1.Text1).
    If you click on the button it calls Form2.Show.

    On Form2 there is one button and a textbox (Form2.Text1).
    If you click on the button it takes the text from Form2.Text1 and puts it in Form1.Text1 and calls Form2.Hide.


    Now my question is this. If you compile this application as .exe, run it, and call the Form2.Show and Form2.Hide, it seems like you can never close it completely.

    If you press control+alt+delete you can still see it in the Close Program Dialog. And if you run it multiple times you can see it multiple times in the Close Program Dialog.

    Is there any better way to "open/close" a form so this doesn't happen?

    Thanks.

    %jeremy

  2. #2
    Frenzied Member Jop's Avatar
    Join Date
    Mar 2000
    Location
    Amsterdam, the Netherlands
    Posts
    1,986

    Load/Unload

    Use Load Form2 and Unload Form2
    to load and unload them into/from the memory!

    Well, Load Form2 is not neccesary, because when you do Form2.Show it automaticly loads it into memory, but when doing Form2.Hide, it only hides it

    [Edited by Jop on 09-07-2000 at 01:45 PM]
    Jop - validweb.nl

    Alcohol doesn't solve any problems, but then again, neither does milk.

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Sep 2000
    Location
    Atlanta
    Posts
    104
    Ok, I've tried that. Like this:

    Form2.Load (get's compile error)

    Do you have a snip of code for an example?.. I have The Visual Basic Bible as reference and couldn't find anything about Load/Unload.

    Thanks.

    %jeremy

  4. #4
    Frenzied Member Jop's Avatar
    Join Date
    Mar 2000
    Location
    Amsterdam, the Netherlands
    Posts
    1,986
    I said:

    Code:
    Unload Form2


    not:
    Code:
    Form2.Unload
    Jop - validweb.nl

    Alcohol doesn't solve any problems, but then again, neither does milk.

  5. #5

    Thread Starter
    Lively Member
    Join Date
    Sep 2000
    Location
    Atlanta
    Posts
    104

    Thumbs up

    =). thank you, you've been helpful.

    Solution: (Thanks to Jop - whos reply I didn't read completely =).)
    To avoid formentioned problem the following code should be used.

    Load Form2 ' this line is optional
    Form2.Show

    Form2.Hide
    Unload Form2

    Thanks.

    %jeremy

  6. #6
    Frenzied Member Jop's Avatar
    Join Date
    Mar 2000
    Location
    Amsterdam, the Netherlands
    Posts
    1,986
    hehe right, no problem
    Jop - validweb.nl

    Alcohol doesn't solve any problems, but then again, neither does milk.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width