Private Sub Timer1_Timer()
Label1.Caption = "百度"
Label1.Caption = "GOOGLE"
Label1.Caption = "讯雷"怎么让他显示的时候循环显示
我这样的显示他只显示第一个和最后一个
中间的不显示
不循环显示
高手帮忙解决下,谢谢

解决方案 »

  1.   

    if Label1.Caption = "百度"  then
    Label1.Caption = "GOOGLE" 
    endif
    if Label1.Caption = "GOOGLE"  then
    Label1.Caption = "讯雷" 
    endif
    if Label1.Caption = "讯雷" then
    Label1.Caption = "百度" 
    endif或者if Label1.Caption = "百度"  then
    Label1.Caption = "GOOGLE" 
    elseif Label1.Caption = "GOOGLE"  then
    Label1.Caption = "讯雷" 
    elseif Label1.Caption = "讯雷" then
    Label1.Caption = "百度" 
    endif或者
    Select case Label1.Caption
    case "百度" 
    Label1.Caption = "GOOGLE"
    case "GOOGLE"
    Label1.Caption = "讯雷" 
    case "讯雷"
    Label1.Caption = "百度" 
    End Select或者if Label1.Caption = "百度"  then Label1.Caption = "GOOGLE" 
    if Label1.Caption = "GOOGLE"  then Label1.Caption = "讯雷" 
    if Label1.Caption = "讯雷" then Label1.Caption = "百度" 或者if Label1.Caption = "百度"  then Label1.Caption = "GOOGLE" elseif Label1.Caption = "GOOGLE"  then Label1.Caption = "讯雷"  elseif Label1.Caption = "讯雷" then Label1.Caption = "百度" 
      

  2.   

    在面板上加timer控件Private Sub Form_Load()
        Label1.Caption = "百度"
    End SubPrivate Sub Timer1_Timer()
        If Label1.Caption = "百度" Then
            Label1.Caption = "GOOGLE"
        ElseIf Label1.Caption = "GOOGLE" Then
            Label1.Caption = "讯雷"
        ElseIf Label1.Caption = "讯雷" Then
            Label1.Caption = "百度"
        End IfEnd Sub
      

  3.   


    Option Explicit'意思差不多是照楼上的方法来做.
    '我就借用一下楼上的代码了.我再进行一下改良'在面板上加timer控件'timer1的interval属性设为1000
    '我再加一个全局变量,用于装载要循环显示的文本Private ShowString(1 To 3) As String
    Private Index As LongPrivate Sub Form_Load()
        ShowString(1) = "百度"
        ShowString(2) = "GOOGLE"
        ShowString(3) = "讯雷"    Index = 1
        Label1.Caption = ShowString(1)
        Timer1.Interval = 1000
        Timer1.Enabled = True
    End SubPrivate Sub Timer1_Timer()
        Index = (Index Mod 3) + 1
        Label1.Caption = ShowString(Index)
    End Sub