一、在窗体上添加控件:一个PictureBox控件,一个Label标签控件,一个Timer控件。
二、在“属性”窗口中设置窗体及各控件的相关属性,控件主要属性设置。
控件类型 | 属性名 | 属性值 | 功能 |
| Name | FrmSplash | 提供闪窗窗体 |
Form | FromBorderStyle | None | 设置为无边框 |
StartPosition | CenterScreen |
| |
| Name | PictureBoxl |
|
PictureBox | Image | 已有的图片 |
|
SizeMode | StretchImage |
| |
Label | Text | 感谢您使用人事管理系统V1.O | |
Timer | Enabled | False |
|
Public Class frmSplash
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Label1.BackColor = Color.Transparent
Label1.Parent = PictureBox1
Timer1.Enabled = True
Timer1.Interval = 10
End Sub
Private Sub Timer1_Tick(ByVal sender As Object, ByVal e As System.EventArgs) Handles Timer1.Tick
Static n As Integer
n = n + 1
Me.Opacity = 1 - n / 100
If Me.Opacity = 0 Then
Dim frmLogin As New frmlogin
frmLogin.show()
Timer1.Stop()
Me.Hide()
End If
End Sub
End Class