CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 6 of 6
  1. #1
    Join Date
    Sep 2000
    Posts
    200

    Make the splash form stay a little longer . . .

    is there a Delay? A Pause? How do you get the splash form to stay for, say 2 seconds?

    Thanks,
    John


  2. #2
    Join Date
    Jan 2001
    Location
    Germany
    Posts
    222

    Re: Make the splash form stay a little longer . . .

    One possible solution would be to place a timer into the spash screen form and set it's delay to a value of, let's say 2000. In the Timer1_timer event you could place a Unload Me statement.

    Don't forget to rate my posts if they help. You can contact me directly at [email protected]
    Teamwork Software - Stuff That Does Something

  3. #3
    Join Date
    Dec 1999
    Location
    Dublin, Ireland
    Posts
    1,173

    Re: Make the splash form stay a little longer . . .

    Add a Timer control to frmSplash and set its Interval property to be 2000.

    Comment out the form_keypress that normally unloads the form:

    private Sub Form_KeyPress(KeyAscii as Integer)
    ' don't unload until timere fires -- Unload me
    End Sub




    and instead make it unload when the timer fires...


    private Sub Timer1_Timer()

    Unload me

    End Sub




    You can vary the time it stays up by altering the Interval porperty of the timer.

    HTH,
    D

    -------------------------------------------------
    Ex. Datis: Duncan Jones
    Merrion Computing Ltd
    http://www.merrioncomputing.com
    '--8<-----------------------------------------
    NEW -The printer usage monitoring application
    '--8<------------------------------------------

  4. #4
    Join Date
    Sep 2000
    Posts
    200

    Re: Make the splash form stay a little longer . . .

    I thought I had it, but the code doesn't execute until the Main form closes . . . (?)


    private Sub Timer1_Timer()
    Unload me
    End Sub






  5. #5
    Join Date
    Jan 2001
    Location
    Germany
    Posts
    222

    Re: Make the splash form stay a little longer . . .

    1. Did you enable the timer?

    2. (if you did enable it) Did you set the splash form to be the starting form of the application? If not, try that and do the initialization tasks (like loading the main form) in the Form_Load procedure of the splash form. Insert another Form.show statement into the timer event procedure to show the main form. That might possibly help.

    Don't forget to rate my posts if they help. You can contact me directly at [email protected]
    Teamwork Software - Stuff That Does Something

  6. #6
    Join Date
    Apr 2000
    Location
    South Carolina,USA
    Posts
    2,210

    Re: Make the splash form stay a little longer . . .

    In SUB Main make sure you have a
    '
    FrmSPlash.Show (Or whatever your splash form is named) BEFORE frmMain.SHOW.
    Also if the frmMain_load procedures are long running, insert a DOEVENTS in long loops so frmSplash will get control once in a while.

    John G

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

Featured