下面是代码,需要一个Timer控件,
设文本框为Text1,其
Text1.MultiLine = True
Text1.ScrollBars=0
将Timer名为Timer1
Timer1.Interval = 100
timer1.Enabled=True
下面是Timer1的Timer事件的代码,实现在你说的功能
Private Sub Timer1_Timer()
Static thisSel As Long
If thisSel = 0 Then thisSel = 1
thisSel = InStr(thisSel + 1, Text1.Text, vbCrLf)
If thisSel > Len(Text1.Text) Then thisSel = 1
Text1.SelStart = thisSel
End Sub
设文本框为Text1,其
Text1.MultiLine = True
Text1.ScrollBars=0
将Timer名为Timer1
Timer1.Interval = 100
timer1.Enabled=True
下面是Timer1的Timer事件的代码,实现在你说的功能
Private Sub Timer1_Timer()
Static thisSel As Long
If thisSel = 0 Then thisSel = 1
thisSel = InStr(thisSel + 1, Text1.Text, vbCrLf)
If thisSel > Len(Text1.Text) Then thisSel = 1
Text1.SelStart = thisSel
End Sub
具体参见http://megatops.digitalrice.com/Download/SE2001_10_Setup.zip的关于的效果。
想要代码,给我油箱,我把窗体给你。
Dim step As IntegerPrivate Sub Command1_Click()
Command1.Enabled = False
Label1.Top = Picture.Height
Timer1.Enabled = True
End SubPrivate Sub Form_Load()
step = 15
Rem
Label1.AutoSize = True
Label1.Left = 0
Label1.Top = Picture.Height
Label1.Caption = "用VB实现的电影字幕效果演示" + Chr$(13)
Label1.Caption = Label1.Caption + "1-第一行文字" + Chr$(13)
Label1.Caption = Label1.Caption + "2-第二行文字" + Chr$(13)
Label1.Caption = Label1.Caption + "3-第三行文字" + Chr$(13)
Label1.Caption = Label1.Caption + "4-第四行文字" + Chr$(13)
Label1.Caption = Label1.Caption + "5-第五行文字" + Chr$(13)
Label1.Caption = Label1.Caption + "6-第六行文字" + Chr$(13)
Label1.Caption = Label1.Caption + "7-第七行文字" + Chr$(13)
Label1.Caption = Label1.Caption + "8-第八行文字" + Chr$(13)
Label1.Caption = Label1.Caption + "9-第九行文字" + Chr$(13)
Label1.Caption = Label1.Caption + "10-第十行文字" + Chr$(13)
Label1.Caption = Label1.Caption + "11-第十一行文字" + Chr$(13)
Label1.Caption = Label1.Caption + "12-第十二行文字" + Chr$(13)
Label1.Caption = Label1.Caption + "13-第十三行文字" + Chr$(13)
Label1.Caption = Label1.Caption + "14-第十四行文字" + Chr$(13)
Label1.Caption = Label1.Caption + "15-第十五行文字" + Chr$(13)
Shape1.BorderColor = &H80000002
Shape1.FillColor = Shape1.BorderColor
Shape1.Height = Shape2.Height - 2
Shape1.Left = Shape2.Left
Shape1.Top = Shape2.Top + 1
Shape1.Width = 1
If step < 0 Then
step = -step
End If
If step = 0 Then
step = 30
End If
Timer1.Interval = step
Timer1.Enabled = False
Command1.Caption = "显示"
End Sub