vb 窗口变大

来源:百度知道 编辑:UC知道 时间:2024/06/14 00:59:25
求教各位高手高脚 我要这样的效果 : 一个窗体由小变大 但是 变大的速度使越来越小 直到窗体一定大小后不再变化。就这样了 如果要打个比喻就是像那个Google Picasa3 软件那样的登陆 模式 窗口由小变大 但变大的速度越来越小 谢谢各位了 我在线等 要用vb 哦
还是没有 达到我想要的那个 效果啊 是越来越小直到停止变化 这个过程是比较快 而且很圆滑 如果要是你 用了 Google Picasa3 打开图片 你就会知道那个效果了

'用定时器
Dim i As Integer
i = ... '赋初值
Private Sub Timer1_Timer()
i = i - 1 '减多少随你
Form1.Height = Form1.Height + i
Form1.Width = Form1.Width + i
If i = 0 Then Timer1.Enabled = False '当i为0时使Timer1不再发生事件
End Sub
'Interval值就是速度

Dim n As Single, m As Single
Private Sub Form_Load()
Timer1.Enabled = True: Timer1.Interval = 1
Me.Move (Screen.Width - Me.Width) * 0.5, (Screen.Height - Me.Height) * 0.5
n = 0.1: m = 1
Me.Visible = False
End Sub

Private Sub Timer1_Timer()
If Me.Width > Screen.Width * 0.8 Then Timer1.Enabled = False: Exit Sub
W = Screen.Width * n: H = Screen.Height * n
Me.Move (Screen.Width - W) * 0.5, (Screen.Height - H) * 0.5, W, H
Me.Visible = True
n = n + 0.02 / m
m = m + 0.05
End Sub