Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Public Class PushBtn
- '列舉類型
- Dim PB_state As Boolean = False '沒按
- '-----Get PB_state-----
- Property _PB_state() As Boolean
- Get
- Return Me.PB_state
- End Get
- Set(value As Boolean) '
- If value = False Then
- PB_state = value '沒按
- Button1.Image = My.Resources.gold_button_hover_md
- Else
- PB_state = value '按下
- Button1.Image = My.Resources.gold_button_md
- End If
- End Set
- End Property
- '按鈕按下動作的處理
- Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
- If PB_state = False Then
- Me._PB_state = True
- Else
- Me._PB_state = False
- End If
- End Sub
- End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement