Splash Screen Impossible?

Discussion in 'AutoCAD' started by D Hartley, Apr 27, 2004.

  1. D Hartley

    D Hartley Guest

    Hi All
    I've searched through Google Groups trying to find how folks have managed
    to produce a splash screen for a VBA AutoCAD application.
    The problem seems to be that, while the code allows you to use a timer, once
    you display a form, control goes to that form until the user clicks it.
    I found an entry using a call to the Windows API (I think) -
    "Declare Sub Sleep Lib "kernel32"
    But control still passes to the form
    Has anybody had this problem before, and how did you solve it? Keep in mind
    that I'm not really a programmer I just play one here.

    Thanks,
    David
     
    D Hartley, Apr 27, 2004
    #1
  2. D Hartley

    pipedrmmr Guest

    David,

    I created a form called 'frmSplash' and this code:

    Private Sub UserForm_Activate()
    TimeWait (0.5) ' Time duration
    Unload Me
    End Sub

    In a standard module I have these 2 subs:

    'Time to wait
    Public Sub TimeWait(PauseTime As Variant)
    Dim Start As Variant
    Start = Timer ' Set start time
    Do While Timer < Start + PauseTime
    DoEvents ' Yield to other processes
    Loop
    End Sub

    Public Sub MyProgram()
    ' Show the splash screen
    frmSplash.Show
    ' Show the main program form
    frmMyProgram.Show
    End Sub

    This works as you want without having to click a button to close the splash window. I hope this helps.

    Lon
     
    pipedrmmr, Apr 27, 2004
    #2
  3. D Hartley

    D Hartley Guest

    Thanks, Lon - It works like a charm.
    I've been amazed at the great help I get here

    David
     
    D Hartley, Apr 28, 2004
    #3
  4. D Hartley

    Dave F. Guest

    I agree with Terry.

    I think the programmer should concentrate on trying to get their code to
    execute properly (which it rarely does).

    Why put something into a routine that actually slows it down?

    Dave F.
     
    Dave F., Apr 28, 2004
    #4
  5. D Hartley

    pipedrmmr Guest

    Dave,
    The reason why I add a standard splash screen to most of my programs is to display copyright info for the company I work for. Several of our calculation programs end up on laptops out in the field (and who knows where else?).
    Lon
     
    pipedrmmr, Apr 28, 2004
    #5
  6. Another reason for using a splash screen is to hide startup processing such
    as connecting to data source. Users don't have as much of a problem waiting
    while a splash screen fires as they do pressing a button and waiting for
    something to happen. Bottom line is it is all in how you apply it.

    For Lon, if copying is an issue you should either invest in Visual Studio
    or upgrade to 2005 [for using .NET and the free IDE SharpDevelop] and start
    programming with DLLs instead of DVBs. Much safer!

    Mike
     
    Mike Tuersley, Apr 28, 2004
    #6
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.