Results 1 to 4 of 4

Thread: closing/opening forms

  1. #1

    Thread Starter
    New Member
    Join Date
    Mar 2007
    Posts
    15

    closing/opening forms

    I am trying to incorperate an open/save function in a program I'm making. I have frmNew that opens on top of my main form(form1). It then has an input box to enter a filename. Once you click on the OK command button my program checks to see if the file exists. My problem is on the next form that opens if the file is found , frmPopup, I need to be able to click cancel and go back to just frmNew with an empty input area. I can clear the input but I'm not quite sure how to close frmPopup and so that it goes back to the begining of frmNew.

    THX

  2. #2
    Frenzied Member
    Join Date
    Aug 2005
    Posts
    1,042

    Re: closing/opening forms

    I think you can just put:
    Me.Hide
    frmNew.Show
    In the Click event of your Cancel Button.

    Not sure if I understood your question correctly, but give it a try.

    Good Luck

  3. #3
    G&G Moderator chemicalNova's Avatar
    Join Date
    Jun 2002
    Location
    Victoria, Australia
    Posts
    4,246

    Re: closing/opening forms

    vb Code:
    1. Unload Me
    Thats all you need to put in the Cancel button of frmPopup.

    chem

    Visual Studio 6, Visual Studio.NET 2005, MASM

  4. #4
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: closing/opening forms

    Unloading is the best solution as it will reset everything fresh for the next time you need the form.

    Just hiding it could leave data in variables that you might not want.

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