加一个 if 语句啊。
if label1.caption="显示" then
label1.caption="隐藏"
......
else
label1.capttion="显示"
.......
end if用select 也行
select label1.cpation
case "隐藏"
label1.caption="显示"
.....
case "显示"
label1.caption="隐藏"
.......
end select

解决方案 »

  1.   

    加一个 if 语句啊。
    if label1.caption="显示" then
    label1.caption="隐藏"
    ......
    else
    label1.capttion="显示"
    .......
    end if用select 也行
    select label1.cpation
    case "隐藏"
    label1.caption="显示"
    .....
    case "显示"
    label1.caption="隐藏"
    .......
    end select
      

  2.   

    用IF语句来改变按钮的Caption属性哦!
      

  3.   

    if command1.caption="显示" then
       command1.caption="隐藏"
    elseif command1.caption="隐藏" then
       command1.caption="显示"
    end if
      

  4.   

    Private Sub Command1_Click()
      Command1.Caption = IIf(Command1.Caption = "显示", "隐藏", "显示")
    End Sub
      

  5.   

    Command1.Caption = IIf(Command1.Caption = "显示", "隐藏", "显示")
      

  6.   

    我懂了,就是点击一个按钮,让它看不见了,再点击它原来所在的位置,又让它显示出来了,对不对?在一个按钮下面放一个ImageBox控件就可以了:
    Private Sub Form_Load()
     '初始化imgImage的位置
     With cmdButton
      imgImage.Move .Left, .Top, .Width, .Height
     End With
    End Sub
    Private Sub imgImage_Click()
     cmdButton.Visible=True
    End SubPrivate Sub cmdButton_Click()
     cmdButtom.Visible=False
    End Sub要注意
      

  7.   

    同意lanying(蓝鹰.net),以事件来过渡。
      

  8.   

    Option ExplicitPrivate Sub Command1_Click()    Command1.Caption = IIf(Command1.Caption = "隐藏", "显示", "隐藏")
        
    End Sub
      

  9.   

    同意mylzw(幻世云) 的看法,不过是在command_click 中加那些指令。
      

  10.   

    private sub command1_click()
        if command1.visible=true then
            command1.visible=false
        else
            command1.visible=true
        end if
    end sub
      

  11.   

    上面是将按钮显示或隐藏下面的代码是改变按钮上显示的文本:
    private sub command1_click()
        if command1.caption="显示" then
            command1.caption="隐藏"
        else
            command1.caption="显示"
        end if
    end sub