How can I create a splash screen?
Applies To: C++Builder 1 or higher
Category: Knowledge Base
- Most Windows applications have a small screen shown at start-up and which contains a logo with image/text. Is it possible to create this kind of splash screen using C++Builder?
-

-
- Start a new project using File | New Application.
-
- Add a second form. Set its BorderStyle to bsNone and its
- FormStyle to fsStayOnTop. You may also add an alClient Bevel that
- will set a border of your choice around the form.
-
- Add a Timer to the second form and set its Interval to 3000
- (three seconds). Edit its OnTimer event:
-
- void __fastcall TForm2::Timer1Timer(TObject *Sender)
- {
- // Close the splash screen after 3 seconds
- Close();
- }
-
- Double-click the OnClose of your second form and insert:
-
- void __fastcall TForm2::FormClose(TObject *Sender,
- TCloseAction &Action)
- {
- Action = caFree;
- }
-
- Add the image or text of your choice.
-
- Go to Project | View Source and change the project source
- to:
-
- try
- {
- Application->Initialize();
- Form2 = new TForm2(Application);
- Form2->Show();
- Form2->Update();
- Application->CreateForm(__classid(TForm1), &Form1);
- Application->Run();
- }
-
- Also add the header file of your second form to this project
- code using #include "Unit2.h".
C++Builder Developer's Network
Copyright © Yoto Yotov