Results 1 to 3 of 3
  1. #1
    Lounger
    Join Date
    Jan 2001
    Location
    Slough, Berkshire, England
    Posts
    46
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Blank Splash Screen (VB6)

    I have a VB6 application which takes a while to do its initialisation, mainly as it connects to a remote database.
    I want to display a splash screen so that the users knows that the application has started.
    I have a SUB MAIN that is coded as follows:
    Public Sub Main()
    frmSplash.Show
    frmSplash.Refresh
    Init
    frmMain.Show
    Unload frmSplash
    End Sub

    The splash form was created with the VB6 wizard and consists of labels and has just the generated code in it.
    ption Explicit

    Private Sub Form_KeyPress(KeyAscii As Integer)
    Unload Me
    End Sub

    Private Sub Form_Load()
    lblVersion.Caption = "Version " & App.Major & "." & App.Minor & "." & App.Revision
    lblProductName.Caption = App.Title
    Me.Refresh
    DoEvents
    End Sub

    Private Sub Frame1_Click()
    Unload Me
    End Sub

    When the application starts I see the outline, without any text, of the splash screen until it is unloaded and the main from is loaded.
    Any suggestions on how I can force the form to display correctly before I start the initialisation in SUB INIT?

    Thank you

  2. #2
    WS Lounge VIP rory's Avatar
    Join Date
    Dec 2000
    Location
    Burwash, East Sussex, United Kingdom
    Posts
    6,280
    Thanks
    3
    Thanked 191 Times in 177 Posts

    Re: Blank Splash Screen (VB6)

    Hi David,
    Instead of having your Main sub call all the code, have it simply show the splash screen, then in the Activate event of the splash screen have code like:
    <pre>Private Sub Form_Activate()
    Me.Refresh
    Init
    frmMain.Show
    Unload Me
    End Sub
    </pre>

    and that should work.
    Hope that helps.
    Regards,
    Rory

    Microsoft MVP - Excel

  3. #3
    Lounger
    Join Date
    Jan 2001
    Location
    Slough, Berkshire, England
    Posts
    46
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Blank Splash Screen (VB6)

    Thank you

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •