This is what I learned during my previous career design. I believe many beginners are looking for this information, here is a simple record for your reference:
Production Program animated window:
The name of your login window is loginform.
Find the Project file (Project-> View Source) and find the following generation parts:
Begin
Application. Initialize;
Application. CreateForm (TForm1, Form1 );
Application. CreateForm (Tloginform, loginform );
Application. Run; // at this point, the program runs
End.
You can set the login window to be created before the program production line:
Begin
Application. Initialize; // Initialization
Loginform: = tloginform. Create (application); // Create a dynamic window
Loginform. Show; // display
Loginform. Update;
Sleep (2000); // the delay of the system is 2 seconds.
Loginform. Hide; // Hide the dynamic window in 2 seconds
Application. CreateForm (TForm1, Form1 );
Application. CreateForm (Tloginform, loginform );
Loginform. Free; // release dynamic window
Application. Run;
End.
Another way to create an animated window... you have also used it ~~) :
Set the cover form attribute so that it meets the requirements for starting the cover. Modify the following cover form attributes:
Position = PoscreenCenter
// The runtime is in the center of the screen
Autosize = true
// Automatically adapt to the Image control to enable full display of the Image
BorderStyle = bsnone
// The Window does not have a title bar or a button for maximizing, minimizing, or closing, or a border.
Name = splashform
Program code parsing
Select the Project/View Scource command under the main menu to open the Project file of this Project. Modify the following code.
Program Project2;
Uses
Forms, Controls,
Unit1 in 'unit1. pa' {MainForm },
Unit2 in 'unit2. pa' {SplashForm };
{$ R *. res}
Begin
Application. Initialize;
SplashForm: = TSplashForm. Create (Application );
// Create a splash form
SplashForm. ShowModal;
// Display the splash form in the mode dialog box
If (SplashForm. ModalResult = mrOK) then
// If the scheduled time reaches or the image on the form is clicked
Begin
Application. Title: = 'test Splash form ';
// Set the application title
Application. CreateForm (TMainForm, MainForm );
// Automatically create the main form
SplashForm. Hide;
// Hide the start cover form
SplashForm. Release;
// Clear the cover form
Application. Run;
End;
End.
Then write the following Event code on the splash form.
Procedure TSplashForm. Timer1Timer (Sender: TObject );
Begin
SplashForm. ModalResult: = mrOK;
// The event handler after the scheduled time
End;
Procedure TSplashForm. Image1Click (Sender: TObject );
Begin
SplashForm. ModalResult: = mrOK;
// Click the event processing program of the splash form image. When a user wishes to manually upload the animated window, the user can enter the main window without waiting, this condition can be added.
End;