Results 1 to 3 of 3

Thread: Loading & Unloading forms

  1. #1

    Thread Starter
    Member
    Join Date
    Mar 2003
    Posts
    47

    Loading & Unloading forms

    I know this is a reeeeaaaally basic question and probably sounds stupid, but here it goes. I've designed an application that runs from one VB form. I have an About menu that brings of a splash screen. When the user clicks the About menu option from the main form, I want the splash screen to load and the main form hidden.


    Wouldn't I just do something like this in the About menu click_event?:

    frmMain.hide
    frmSplash.load

    These aren't working for me. What's wrong??

    Thanks!!

  2. #2
    Frenzied Member Buzby's Avatar
    Join Date
    Jan 1999
    Location
    UK
    Posts
    1,670
    You're not actually showing the about screen. (and frmSplash.load is not valid VB)

    try this:


    frmMain.hide
    load frmSplash
    frmSplash.show



    You will need to put some code in the Unload event of the splash screen to re-display the main screen.

    eg;

    Private Sub Form_Unload(Cancel As Integer)
    frmMain.show
    End Sub
    'Buzby'
    Visual Basic Developer
    "I'm moving to Theory. Everything works there."

  3. #3
    Frenzied Member Buzby's Avatar
    Join Date
    Jan 1999
    Location
    UK
    Posts
    1,670
    The other question I should ask, is why do you want the main form to disappear in the first place - a better solution would be to do

    Load frmSplash
    frmSplash.Show 1


    which would display the splash screen 'modally' on top of the main form - this means the user won't be able to click on the main form until the splash form has been closed. This is the norm for splash screens.
    'Buzby'
    Visual Basic Developer
    "I'm moving to Theory. Everything works there."

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