如何让一行文字从一个文本框从左向右不停的循环滚动呢.
就像车站的电子滚动屏那样的.
希望把代码写得完整些.

解决方案 »

  1.   

    加入一个timer控件
    Private Sub Timer1_Timer()
        '80是文本框长度
        If Len(text1.Text) < text1.width / 80 Then
            text1.Text = " " + text1.Text
        Else
            text1.Text = LTrim(text1.Text)
        End If    
    End Sub
      

  2.   

    用TIMER控件就可以实现了,还能做一些简单的动画
      

  3.   

    Dim Str as String,StrTemp as String'全局变量
    Private Form_Load()
        '80是文本框长度
        Timer1.Enabled = False
        if len(strTemp)=0 then
        Str="中国人民共和国"
        StrTemp=space(80) & str
        Timer1.Enabled = True
    End Sub
    Private Sub Timer1_Timer()
        StrTemp=Right(StrTemp,Len(StrTemp)-1) & Left(StrTemp,1)
        Text1.Text=StrTemp
    End Sub
      

  4.   

    很简单的东西
    Dim intMsg As Integer
    Dim strMsg As String
    Dim str1 As String,str2 As String
    Private Sub Timer1_Timer()
        intMsg=Len(Text1.Text)
        strMsg=Text1.Text
        str1=left(strMsg,1)
        str2=right(strMsg,intMsg-1)
        Text1.Text=str2 & str2
    End Sub