Quesion about loading/unloading/hiding forms

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Anthony P.

    Quesion about loading/unloading/hiding forms

    Hello Everyone,

    I'm writing an application that, so far, only has three forms:

    frmSplashScreen
    frmLicenseScree n
    frmConfiguratio nScreen

    Now, frmSplashScreen has a timer that sits it on screen for 2 seconds
    then executes the following commands:

    frmLicenseScree n.Show()
    Me.Hide()

    So, frmLicenseScree n is loaded properly and frmSplashScreen is HIDDEN
    (not closed becasue that would kill the application).

    Next, there is a button click that executes the following commands:

    frmConfiguratio nScreen.Show()
    Me.Close()

    At this point, the ONLY form being shown on the screen is
    frmConfiguratio nScreen. That's true for about 2 seconds. After that,
    frmLicenseScree n pops up again and we start the process all over
    again.

    I'm confused. I know I can't Me.Close() frmSplashScreen since that
    would kill the application. But what am I doing wrong that is making
    frm.LicenseAgre ement reopen?

    Thanks in Advance,
    Anthony
  • Miro

    #2
    Re: Quesion about loading/unloading/hiding forms

    You most likely have your main form on a timer that keeps re-running as the
    interval hits.

    You can assign a splash screen through the Project Properties portion, and
    still have your 'Main Form' be your main form.
    -In your Solutions explorer, right click on your Project Name, click
    properties.
    Then go to the 'Application tab' on the left.
    Take a look at yoru startup form - and also scroll down to the bottom, and
    notice there is a spot to put a splash screen as well ( if you do not want
    to do this manually. )

    The other manual way of doing this is making your "Main Form" be your main
    form, and within the form load of it, open up the other form, show it for 2
    seconds, and then close it.

    If your frmConfiguratio nScreen is your 'MainForm', ... I would load that,
    and load the others around it.

    Miro



    "Anthony P." <papillion@gmai l.comwrote in message
    news:a07bc75b-542b-49ce-8efd-dd116b8a0c9d@x4 1g2000hsb.googl egroups.com...
    Hello Everyone,
    >
    I'm writing an application that, so far, only has three forms:
    >
    frmSplashScreen
    frmLicenseScree n
    frmConfiguratio nScreen
    >
    Now, frmSplashScreen has a timer that sits it on screen for 2 seconds
    then executes the following commands:
    >
    frmLicenseScree n.Show()
    Me.Hide()
    >
    So, frmLicenseScree n is loaded properly and frmSplashScreen is HIDDEN
    (not closed becasue that would kill the application).
    >
    Next, there is a button click that executes the following commands:
    >
    frmConfiguratio nScreen.Show()
    Me.Close()
    >
    At this point, the ONLY form being shown on the screen is
    frmConfiguratio nScreen. That's true for about 2 seconds. After that,
    frmLicenseScree n pops up again and we start the process all over
    again.
    >
    I'm confused. I know I can't Me.Close() frmSplashScreen since that
    would kill the application. But what am I doing wrong that is making
    frm.LicenseAgre ement reopen?
    >
    Thanks in Advance,
    Anthony

    Comment

    • Anthony P.

      #3
      Re: Quesion about loading/unloading/hiding forms

      You most likely have your main form on a timer that keeps re-running as the
      interval hits.
      You're right. Never even dawned on me that it was the timer creating
      the problem. I guess I didn't think that, once a form was hidden, the
      timer would keep firing. That solves that!
      You can assign a splash screen through the Project Properties portion, and
      still have your 'Main Form' be your main form.
      -In your Solutions explorer, right click on your Project Name, click
      properties.
      Then go to the 'Application tab' on the left.
      Take a look at yoru startup form - and also scroll down to the bottom, and
      notice there is a spot to put a splash screen as well ( if you do not want
      to do this manually. )
      I knew that but, for some reason (which I can't remember now) chose
      not to use it. Since I can't really remember why I didn't use it, I
      think I might go back and try it to see what happens.

      Thanks for your help!

      Anthony

      Comment

      • Miro

        #4
        Re: Quesion about loading/unloading/hiding forms

        If you do not want to,
        just do this ( if you still want it to work on a timer )

        Start your main form,
        start a timer - on an interval

        within the timer code put
        timer.enabled = false
        ( so no other forms will pop up )

        and then you can close the form whenever you need to.

        I wanted to show my splash screen longer for non registered users so I did
        somethign like this:
        (written in notepad ) but you should get the idea...
        main form was loaded
        within main form_load i did:
        timer1.enabled = true
        ( i wanted the main form to load and wait 5 seconds before showing the
        screen )

        on the timer routine i did
        timer1.enabled = false
        splashscreen.sh owmodal()

        then within splashform on form load I added a new timer ( we will call it
        timer 2 )
        timer2.enabled = true
        within the timer event
        form.close()

        that way I was able to hit my timer1 anytime i saw fit to show a modal
        screen overtop of my mdi form,
        and within timer2 i was able to make it last for an X amount of time until I
        saw fit befoer it dissapeared.

        Was an easy solution to give someone a quick demo of a quick exe that worked
        100% but still had a splash screen showing
        here and there that was bothersome enough to be an annoyance.

        quick and dirty - but it worked.

        Miro


        "Anthony P." <papillion@gmai l.comwrote in message
        news:22eae3fd-86e8-4b3b-b0b9-2936772b66c5@k1 3g2000hse.googl egroups.com...
        >You most likely have your main form on a timer that keeps re-running as
        >the
        >interval hits.
        >
        You're right. Never even dawned on me that it was the timer creating
        the problem. I guess I didn't think that, once a form was hidden, the
        timer would keep firing. That solves that!
        >
        >You can assign a splash screen through the Project Properties portion,
        >and
        >still have your 'Main Form' be your main form.
        >-In your Solutions explorer, right click on your Project Name, click
        >properties.
        >Then go to the 'Application tab' on the left.
        >Take a look at yoru startup form - and also scroll down to the bottom,
        >and
        >notice there is a spot to put a splash screen as well ( if you do not
        >want
        >to do this manually. )
        >
        I knew that but, for some reason (which I can't remember now) chose
        not to use it. Since I can't really remember why I didn't use it, I
        think I might go back and try it to see what happens.
        >
        Thanks for your help!
        >
        Anthony

        Comment

        Working...