第29天 像星际争霸开头由大到小的字幕特效
5/15/2000 0:0:0· ·歪歪··cpcw
下面这个范例不用说太多,它给大家证明了一个真理:最复杂的东西往往是最简单的东西组合成的。不要每天去追逐各种各样的控件,用好最简单的东西是一件很困难的事情。
在窗体中加入一个Timer(定时器),标签(Label)
Private Sub Form_Load()
With Me
.BackColor = vbBlack
.WindowState = vbMaximized
End With
With Label1
.Alignment = vbCenter
.AutoSize = True
.BackColor = vbBlack
.Caption = "歪歪的VB教程"
.Font.Name = "宋体"
.Font.Size = 150
.ForeColor = vbGreen
.Visible = True
End With
With Timer1
.Interval = 1
.Enabled = True
End With
End Sub
Private Sub Timer1_Timer()
With Label1
If .FontSize $#@62; 2 Then
.FontSize = .FontSize - 2
.Left = (Me.Width - .Width) / 2
.Top = (Me.Height - .Height) / 2
Else
.Visible = False
Timer1.Enabled = False
End If
End With
End Sub