您当前的位置:首页 > 计算机 > 编程开发 > VB

VB编程:仿QQ聊天框的抖动效果

时间:05-25来源:作者:点击数:

VB编程:仿QQ聊天框的抖动效果

Dim a
Private Sub Command1_Click()
    a = 0
    Timer1.Enabled = True
End Sub

Private Sub Form_Load()
    Timer1.Enabled = False
    Timer1.Interval = 50
    Timer2.Enabled = False
    Timer2.Interval = 8000
End Sub

Private Sub Timer1_Timer()
    Static b As Integer
    Timer2.Enabled = True
    If a = 0 Then
        Me.Top = Me.Top + 80
        a = a + 1
    ElseIf a = 1 Then
        Me.Left = Me.Left + 80
        a = a + 1
    ElseIf a = 2 Then
        Me.Top = Me.Top - 80
        a = a + 1
    ElseIf a = 3 Then
        Me.Left = Me.Left - 80
        a = 0
    End If
    b = b + 1
'    Print b   '抖动次数
End Sub

Private Sub Timer2_Timer()
    If Timer1.Enabled = True Then
        Timer1.Enabled = False
        Timer2.Enabled = False
    
    End If
End Sub

 

方便获取更多学习、工作、生活信息请关注本站微信公众号城东书院 微信服务号城东书院 微信订阅号
推荐内容
相关内容
栏目更新
栏目热门