Private Sub Form_Load() Timer1.Interval = 300 Label1.Left = 0 End SubPrivate Sub Timer1_Timer() Label1.Left = Label1.Left + 100 End Sub
是在窗体上移动吗?用timer控件和move方法实现
Private Sub Form_Load() Timer1.Interval = 300 Label1.Left = 0 End SubPrivate Sub Timer1_Timer() Label1.Left = Label1.Left + 100 if Label1.Left>form.width then label1.left=0 end if End Sub
使用一个label控件和一个TIMER控件, option explicit dim StrLen as long sub from_load() StrLen=len(label1.caption) end subSub Timer1_Timer() dim A as string A=label1.cation 'label1.caption= Right(A,StrLen -1) & left(A,1) '这句是向左移动的 'label1.caption= Right(A,1) & left(A,StrLen -1) '这句是向右移动的 end sub 上面模块中的两句分别是向左移动和向右移动的,喜欢哪一个把前面的注释号去掉就可以了。 想滚动得快一点就将TIMER的interval属性设得小一点。自己看一下效果吧
Timer1.Interval = 300
Label1.Left = 0
End SubPrivate Sub Timer1_Timer()
Label1.Left = Label1.Left + 100
End Sub
Timer1.Interval = 300
Label1.Left = 0
End SubPrivate Sub Timer1_Timer()
Label1.Left = Label1.Left + 100
if Label1.Left>form.width then
label1.left=0
end if
End Sub
option explicit
dim StrLen as long
sub from_load()
StrLen=len(label1.caption)
end subSub Timer1_Timer()
dim A as string
A=label1.cation
'label1.caption= Right(A,StrLen -1) & left(A,1) '这句是向左移动的
'label1.caption= Right(A,1) & left(A,StrLen -1) '这句是向右移动的
end sub
上面模块中的两句分别是向左移动和向右移动的,喜欢哪一个把前面的注释号去掉就可以了。
想滚动得快一点就将TIMER的interval属性设得小一点。自己看一下效果吧