由于公司最近有个东西需要vb来做,作为初学者;这里想问各位前辈一个关于关于字幕滚动 的问题;我知道可以用timer去定时移动Lable的位置实现字幕滚动,不过好象效果一般,
想问是否有这方面比较理想或好用的控件使用;可以实现垂直方向和水平方向的滚动的 
谢谢拉;大家拉

解决方案 »

  1.   

    '首先建立一个窗体,在其上放置两个TIMER,一个按钮、一个文本框。将文本框的MultiLine属性设为True,ScrollBars属性设为3-Both。
    '然后输入以下代码:
         Const EM_LINESCROLL = &HB6
         Private Declare Function SendMessage Lib "User32" Alias _
         "SendMessageA" _
         (ByVal hWnd As Long, _
         ByVal wMsg As Integer, _
         ByVal wParam As Integer, _
         ByVal lParam As Long) As Long
         
         Private Sub Form_Load()
         Dim intLineIndex As Integer, intWordIndex As Integer
         
         'Initialize Text1.
         Text1.Font = "Courier New"
         Text1.Text = ""
         For intLineIndex = 1 To 50 'Add 25 lines of text.
         Text1.Text = Text1.Text & "Line" & Str$(intLineIndex)
         For intWordIndex = 1 To 30 'Make each line 12 words
         'long.
         Text1.Text = Text1.Text & " Word" & Str$(intWordIndex)
         Next intWordIndex
         Text1.Text = Text1.Text & vbCrLf
         Next intLineIndex
    Timer1.Enabled = True
    Timer2.Enabled = False
    Timer1.Interval = 1000
    Timer2.Interval = 1000
         End Sub
         
         Private Sub Command1_Click()
     Timer1.Enabled = Not Timer1.Enabled
      Timer2.Enabled = Not Timer2.Enabled
         End Sub
         
    Private Sub Timer1_Timer()
    SendMessage Text1.hWnd, EM_LINESCROLL, 0, 3
    End SubPrivate Sub Timer2_Timer()
    SendMessage Text1.hWnd, EM_LINESCROLL, 3, 0&
    End Sub
    用RICHTEXTBOX 效果会更好一些.
      

  2.   

    也给我一个,谢谢!
    [email protected]
      

  3.   

    也给我个谢谢
    [email protected]
      

  4.   

    也给我一个,谢谢:
    [email protected]
      

  5.   

    建议还是用标签做吧,文本框和RICHTEXTBOX显示时都有个光标,看上去感觉不爽。