----In a large number of application software, after the software is started, a screen displays information for a few seconds, listing the product, platform, version number and copyright information, which is called the "flashing screen when starting the program". How is it implemented in Visual Basic? This article discusses one way to generate a splash screen and make it colorful. Make sure that when the startup screen stays on the desktop, the prompt text "flows" on the desktop (such as the "Orient Express" startup screen). At the same time, effects such as flashing and color changing of flowing text can also be achieved. If you set the screen at the bottom of the text, the text can flow from the screen. After the display is completed and disappears from the top of the screen, it can rise again from the bottom of the screen and reappear in a loop. After this design, it can be used in software descriptions, author lists, etc. to enrich the software's screen display.
----Take project 1, forms Form1 and Form2, and set Form1 as the startup form. Create new Frame1, Timer1 and Temer2 on Form2, and set the Caption property of Frame1 to a null value to form a beautiful three-dimensional border. The Enabled properties of Timer1 and Temer2 are set to True. Create Picture1 on Frame1 and adjust Picture1 to a suitable size. Set the ScaleMode property of Form1 to 1-Twip and the StartUpPosition property of Form2 to 2-CenterScreen (center aligned). In order to ensure that Form2 does not display the "blue description bar" at the top of the form, set the Caption property to a null value and the ControlBox property to False. Create label Label1 on Picture1 and adjust BackStyle to 0 (transparent). Fill in the text "Author: Miss Jiang Xue of Shenyang" in the Caption attribute of Label1 for easy observation. Adjust text size and color. You can freely set layout information on the form Form2.
----Form1 code is as follows:
PRivateSubForm_Load()
Form1.Visible=0'makes the form Form1 invisible
Form2.Show'display form Form2
EndSub
The codes for each control in Form2 are as follows:
OptionExplicit
DimStep1,Step2,Step3AsInteger
DimZfAsString
DimIAsInteger
PrivateSubForm_Click()
'When you click Form2, end the execution of Form2,
Display form Form1 and close Timer and Timer1.
UnloadMe
Form1.Show
Timer1.Enabled=False
Timer2.Enabled=False
EndSub
PrivateSubForm_Load()
Picture1.Picture=LoadPicture
("c:/windows/Clouds.bmp")'Choose a picture
Timer1.Interval=80' time step
Timer2.Interval=50
EndSub
PrivateSub
Frame1_Click()'When clicking the area within the control Frame1,
End the execution of form Form2, display form Form1, and close Timer and Timer1.
UnloadMe
Form1.Show
Timer1.Enabled=False
Timer2.Enabled=False
EndSub
PrivateSub
Picture1_Click()
'When you click the area within Picture1, end the execution of Form2,
Display form Form1 and close Timer and Timer1.
UnloadMe
Form1.Show
Timer1.Enabled=False
Timer2.Enabled=False
EndSub
PrivateSubTimer1_Timer()
ColorLabel1,15,13,9' calls the transformed color
I=I 1
IfI>50Then'Form2 form stay time, can be resized
UnloadMe
Form1.Show
Timer1.Enabled=False
Timer2.Enabled=False
EndIf
EndSub
SubColor(CtrlAsControl,color1AsInteger,
color2AsInteger,color3AsInteger)'Select color
IfVal(Ctrl.Tag)=color1Then
Ctrl.Tag=color2
ElseIfVal(Ctrl.Tag)=color2Then
Ctrl.Tag=color3
ElseIfVal(Ctrl.Tag)=color3Then
Ctrl.Tag=color1
Else
Ctrl.Tag=color1
EndIf
Ctrl.ForeColor=QBColor(Ctrl.Tag)
EndSub
PrivateSubTimer2_Timer()' controls text movement position and speed
Step1=1800:Step2=4500:Step3=40
IfLabel1.Top<-Step1-Label1.TopThen
Label1.Top=Label1.Top Step2
EndIf
Label1.Top=Label1.Top-Step3
EndSub
----You can adjust the values of Timer1.Interval and Timer2.Interval, which determine the text color change speed and text flow speed respectively; adjust Step1 and Step2 to appropriate values according to the form and control conditions; Step3 is the text jump step; Change the text transformation color by changing the I, J, K values in the ColorLabel1, I, J, K statement. Implemented under Chinese VisualBasic5.0. ->