vb time 控件产生的动画

来源:百度知道 编辑:UC知道 时间:2024/06/19 22:08:09
用定时器控件(Timer)来产生动画效果:要求单击“启动”按钮后,字符串“学生技能”由左边界向右移动到窗体的中央。

谁会做的教教我吧 急用

不用控件的方法:事先timer控件的interval属性设为10
Private Sub Timer1_Timer()
Static S As Long
Cls
Me.CurrentX = S
S = S + 1
Me.FontSize = 20
Me.ForeColor = RGB(255, 0, 0)
Me.Print "学生技能"
End Sub

可以用控件不?
可疑的话
创建一个label
caption设置成 学生技能

private sub command1_click()'启动按钮
label1.left=me.width
timer1.interval=10
timer1.enabled=true
end sub

private sub timer1_timer()
if label1.left>me.width/2-label1.width/2 then
label1.left=label1.left-30'
else
timer1.enabled=false
end if
end sub

把分给zhangxnwc吧,我抄他的。
Private Sub command1_click() '启动按钮
Label1.Left = 0
Timer1.Interval = 10
Timer1.Enabled = True
End Sub

Private Sub Form_Load()
Timer1.Enabled = False
End Sub

Private Sub timer1_timer()
If Label1.Left < Me.Width / 2 - Label1.Width / 2 Then
Label1.Left = Label1.Left + 30 '