Library tutorials & articles

Splash Screens

Creating it

As you develop your application you will find that your application takes an increasing amount of time to load. If this is the case, it is probably worth creating a splash screen. To create a splash screen you can either create it from scratch or use a VB template included in VB5 and VB6. Both methods will be covered here.

Method 1: Use a VB template

Select Projects | Add Form. Then select Splash screen from the list of items and click OK. All you need to do now is change some of the label captions. When the form is shown during run time, the code (which is already written) will automatically show the Application name, and versions. The only thing you need to set at design time is the company name and copyright information. To do this, simply select the Company label, and set the caption property to your company name. You can do the same for the copyright information. For more information on labels, click here. You can also change the image displayed in the Picture Box.

Method 2: Create the form from scratch

Select Projects | Add Form. Then select Form from the list of items and click OK. Then set the form properties to the following values

Property Value
Caption (Blank)
BorderStyle 3-Fixed Dialog
ControlBox False
MaxButton False
MinButton False

Now you need to add a view labels and a Picture box. As an example, you could use the following layout.

splshscr.gif (4705 bytes)

All items are labels, except the book, which is a Image control. To change the image, click the ... next to the Picture Property. You can also set the version label to automatically show the current version, so you do not have to change the label caption every time your product version changes. You can use the following code where lblVersion is the name of the Version label.

lblVersion.Caption = "Version " & App.Major & "." & _
        App.Minor & "." & App.Revision

AddThis

Comments

  1. 20 May 2005 at 02:09

    i am running vb.net 2003. I cannot get the code for a splash screen to work. It is possible for u to send me code so it will work. Thanks

  2. 04 Oct 2004 at 23:39

    Hi,
    I am working on a VB.NET application and wanted to implement a Splash screen, I have created a form from Scratch and pasted my .jpeg file on that form. In my main function, I have created an instance of that form
            dim splash as frmSplash
            splash = new frmSplash()


            splash.show()
    at this point, I can see a window only on the Windows task bar but not displayed on Screen. after this a statement is executed for main form i.e.
            frmMain.showDialog()
    after this statement, screen appears above main form.


    When i use
            splash.showDialog() in place of splash.show(),
    the screen appears as required but application will not proceed furthur. It is not moving to next statement at all.
    how can i correct this problem?

  3. 23 Feb 2004 at 15:44

    that bits obvious, but where about in the coding bo you put the interval bit (no, i cant read very well by the way)

  4. 17 Nov 2002 at 04:33

    Add a timer to the splash form and click on it to edit the properties

  5. 19 Jul 2002 at 14:27

    where do you put the interval


  6. 01 Jul 2002 at 19:14

    It is a good one, simple and to the point

  7. 23 Jan 2002 at 06:41

    thanks for the great tutorial, it was very easy to understand


    Thanks
    Mark

Leave a comment

Sign in or Join us (it's free).

Related discussion