用 VB设计字从左到右,从右到左,从上到下,从下到上的滑动
分别用四个计时器对该对应的字进行设置,如果字滑动到了窗体边就从窗体的另一边过来,以此类推......
分别用四个计时器对该对应的字进行设置,如果字滑动到了窗体边就从窗体的另一边过来,以此类推...
展开
1个回答
2014-03-28
展开全部
Private Sub Command1_Click()
Timer1.Enabled = True
Timer2.Enabled = True
Timer3.Enabled = True
Timer4.Enabled = True
End SubPrivate Sub Command2_Click()
Timer1.Enabled = False
Timer2.Enabled = False
Timer3.Enabled = False
Timer4.Enabled = False
End SubPrivate Sub Timer1_Timer()
If Label1.Left <= Form1.Width - Label1.Width Then
Label1.Left = Label1.Left + 50
Else
Label1.Left = 0
End If
End SubPrivate Sub Timer2_Timer()
If Label2.Top <= Form1.Height - Label2.Height Then
Label2.Top = Label2.Top + 50
Else
Label2.Top = 0
End If
End SubPrivate Sub Timer3_Timer()
If Label3.Top >= 0 Then
Label3.Top = Label3.Top - 50
Else
Label3.Top = Form1.Height - Label3.Height
End If
End SubPrivate Sub Timer4_Timer()
If Label4.Left > 0 Then
Label4.Left = Label4.Left - 50
Else
Label4.Left = Form1.Width
End If
End Sub
Timer1.Enabled = True
Timer2.Enabled = True
Timer3.Enabled = True
Timer4.Enabled = True
End SubPrivate Sub Command2_Click()
Timer1.Enabled = False
Timer2.Enabled = False
Timer3.Enabled = False
Timer4.Enabled = False
End SubPrivate Sub Timer1_Timer()
If Label1.Left <= Form1.Width - Label1.Width Then
Label1.Left = Label1.Left + 50
Else
Label1.Left = 0
End If
End SubPrivate Sub Timer2_Timer()
If Label2.Top <= Form1.Height - Label2.Height Then
Label2.Top = Label2.Top + 50
Else
Label2.Top = 0
End If
End SubPrivate Sub Timer3_Timer()
If Label3.Top >= 0 Then
Label3.Top = Label3.Top - 50
Else
Label3.Top = Form1.Height - Label3.Height
End If
End SubPrivate Sub Timer4_Timer()
If Label4.Left > 0 Then
Label4.Left = Label4.Left - 50
Else
Label4.Left = Form1.Width
End If
End Sub
本回答被网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询