Results 1 to 4 of 4

Thread: show method not working [RESOLVED]

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Nov 2003
    Posts
    1,489

    show method not working [RESOLVED]

    I can show form2 from form1 with this:
    Code:
     
    form2.show()
    and I can get it to close using the close method.

    the problem, however, is that when I go for a second showing of it, I get this message:
    Cannot access a disposed object named "Form2".

    I dim an instance of it in the declaration section of form1(that's where I'm showing and closing it)

    what causes this and what do I do to be able to show it multiple times?
    Last edited by Andy; Dec 29th, 2003 at 03:14 AM.

  2. #2
    Fanatic Member
    Join Date
    Oct 2000
    Location
    Reading, UK
    Posts
    870
    instead of closing it set it's visible property to false, and then true.

    Otherwise you will have to 'dim' up a new instance of your form as form1.close will destroy the instance of it created
    www.vb-tech.com
    .Net Freelance Development
    http://weblog.vb-tech.com/nick
    My blog

  3. #3
    Lively Member
    Join Date
    Oct 2003
    Location
    Europe, Belgium
    Posts
    84
    hi,

    form2.hide() also does the job.

    tom

  4. #4

    Thread Starter
    Frenzied Member
    Join Date
    Nov 2003
    Posts
    1,489

    Wink

    thanks guys!! so, closing the form also destroys the variable, eh? DID NOT KNOW THAT.

    I'll have enough knowledge hanging out here to lead my own development team lol

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