Make sputter screen with Delphi

zhaozj2021-02-08  235

(Author: Shi Road, 2000 at 09:32 on December 8) well-written show up precautions WINDOWS program, known as the splash screen (splash screen). Using a little small content, you can add a lot of colors to the display. Since the project itself creates a program's main window, and the start sputter screen must appear before the main window is created, the project file must create its own startup screen. This means that the user must modify the source code to create an engineering file, which is usually unnecessary in Delphi programming. The following process introduces the establishment of the sputter screen. 1. Start a new project. Name the form to MAINFORM, and set its CAPTION property to Splashindemo. Save this project in a directory, such as C: / Projects / Splashin. Name the main unit of MainForm, named the project file Splashin. 2, insert a Button component in MainForm. Change the Button's Name property to ExitButton, and change its Caption property to Exit. Create a processor for ExitButton's OnClick event, insert a close; statement between the process's begin and End keywords. 3, select the file | new form command, or click the New Form Speed ​​button. Add a new form. 4. Change the Name property of this form to SplashForm to delete its CAPTION property. In addition, the BorderStyle property is changed to BSNON, and the three sub-values ​​under Bordericons are set to false. 5, save this project. When the Delphi prompts the reader to provide a unit file name, be confident that the current directory is the correct directory. Enter SPLASH in the unit file name of Splashform. 6. Set the SplashForm's enabled attribute to false. Here you don't want users to provide keyboards and mouse commands to the window, this is one of the very few cases. In this example, we want the program to have complete control over the SplashForm's display. 7. Since the window has no contour, an Bevel component object is inserted from the Additional component class. This helps define the edge of the window. Set the Align property of Bevel1 to AlClient. At the same time, change the SHAPE attribute of the object to BSFrame, and change its style attribute to BSRAISED. These values ​​are determined by the user. 8. Insert the components you want to use in the SplashForm, do not insert any buttons or other interactions. The application itself displays and removes the start sputter dialog. 9, select the Project menu. Highlight the Splash engineering pop-up menu. Select the Options command. In the Produced Project Options dialog box, select the Forms page tag. Note that MainForm and Splashform are located in the list of automatically created forms. Highlight each form and click the right button to move it to the Available Form. All Delphi Forms are automatically created in memory at runtime, which is consumed to consume memory and system resources. In such a case, the program is created in the runtime, and the reader should remove the form from the list of automatically created lists. Close the ProjectOptions window. 10. Next, modify the source code of the project so that the sputter dialog box is displayed before the main window is displayed. Here you need to insert the statement in the project file to match the Splash.DPR project file.

转载请注明原文地址:https://www.9cbs.com/read-1444.html

New Post(0)