VB窗体加载特效

来源:百度知道 编辑:UC知道 时间:2024/05/31 03:06:20
启动窗体时:

窗体是一点,然后一直放大到标准尺寸

关闭窗体是:

从标准尺寸开始缩小 缩小到一点然后消失

要一段可以调整速度的代码
taohongjie 代码你测试过勒马?可用吗?测试以后再发 谢谢合作

Dim b As Boolean

Private Sub Form_Load()
Me.Width = 1
Me.Height = 1
b = False

End Sub

Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
b = True
Cancel = 0
End Sub

Private Sub Timer1_Timer()
If b = False Then
If Me.Width <> 3600 Then Me.Width = Me.Width + 1 '3600为你的标准宽度
If Me.Height <> 3600 Then Me.Height = Me.Height + 1 '3600为你的标准高度
Else
If Me.Width <> 1 Then Me.Width = Me.Width - 1
If Me.Height <> 1 Then Me.Height = Me.Height - 1
If Me.Width = 1 And Me.Height = 1 Then End
End If
End Sub
如果你的窗体没边框的话就可以到一个点

可以用一个timer控件实现
Private Sub Form_Load()
Me.Left = Screen.Width / 2
Me.Top = Screen.Height / 2
Me.Height = 0
Me.Width = 0
Timer1.Enabled = True
End Sub

Private Sub Timer1_Timer()
Form1.Height = Form1.Height + 50'50是放大的速度