VBA_控件01

'CommandButton的屬性
    Sub attribute1()
        '可用性:false不可用, true可用
        Sheet2.CommandButton1.Enabled = True
    End Sub
Sub attribute2()
    '標題
    Sheet3.CommandButton1.Caption = "按鈕"
End Sub
Sub attribute3()
    '可見性:false隱藏,true顯示
    Sheet2.CommandButton1.Visible = True
End Sub
Sub size()
     '大小
    With Sheet2
        .CommandButton1.Width = 100
        '.CommandButton1.Height = 28
    End With
End Sub
Sub move1()
      '移動
    With Sheet3
       .CommandButton1.Top = .CommandButton1.Top + .CommandButton1.Height
       .CommandButton1.Caption = "來追我啊,大傻子"
    End With
End Sub
Sub move2()
      '移動
    With Sheet3
       .CommandButton1.Left = .CommandButton1.Left + .CommandButton1.Width
       .CommandButton1.Caption = "來追我啊,大傻子"
    End With
End Sub

'CommandButton事件
Private Sub CommandButton1_Click()
MsgBox ("哪裏不會點哪裏喲!")
End Sub

Private Sub CommandButton1_MouseMove(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
Call move2
End Sub

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章