高手,
如何使FORM窗体标题由右向左流动????

解决方案 »

  1.   

    不明白你的意思
    是caption改变吗?
      

  2.   

    在标题前加上一些空格构造一个字符串,通过timer来定时触发时间,每次移除最开始的一个字符(从空格开始移除),并在标题中显示,当字符串为""时,循环重新构造字符串。
      

  3.   

    测试通过
    Private Sub Command1_Click()
        If Timer1.Enabled = False Then
            Timer1.Enabled = True
        Else
            Timer1.Enabled = False
        End If
    End SubPrivate Sub Form_Load()
        Timer1.Interval = 500
        Form1.Caption = Space(90) & "欢迎使用本系统"
        Form1.WindowState = 2
    End SubPrivate Sub Timer1_Timer()
        Form1.Caption = Mid(Form1.Caption, 5, Len(Form1.Caption))
        If Len(Form1.Caption) = 0 Then
            Form1.Caption = Space(90) & "欢迎使用本系统"
        End If
    End Sub
      

  4.   

    '简单例子
    Dim i As Integer
    Dim strCaption As String
    Private Sub Command1_Click()
        Timer1.Enabled = True
    End SubPrivate Sub Form_Load()
        i = 0
        Timer1.Enabled = False
        Timer1.Interval = 100
        strCaption = Form1.Caption
    End SubPrivate Sub Timer1_Timer()
        i = i + 1
        Dim j As Integer
        strspace = Space(i)
        Form1.Caption = strspace & Form1.Caption
        If i > 20 Then
            i = 0
            Form1.Caption = strCaption
        End If
    End Sub
      

  5.   

    Dim num As Long
    Const x = "滚动的标题"
    Dim i As Long
    Private Sub Form_Load()
    Timer1.Interval = 100
    num = (Me.Width - Me.TextWidth(x)) / Me.TextWidth(" ")
    i = num
    End SubPrivate Sub Timer1_Timer()
    i = i - 1
    Me.Caption = String(i, " ") & x
    If i = 0 Then i = num
    End Sub