# Re: 怎样写才可以使电脑知道(command)已经被人按过?

Posted by 小瓜瓜 on August 15, 1999 at 00:00:04:

In Reply to: Re: 怎样写才可以使电脑知道(command)已经被人按过? posted by j on August 14, 1999 at 19:44:52:

: : 如题

: 小弟的做法是宣告一个公用变数来判断

: Dim a As Boolean

: Private Sub Command1_Click()
: If a = False Then
: a = True
: MsgBox "没有被人按过"
: Else
: MsgBox "有被人按过"
: End If
: End Sub

善用Tag属性
Private Sub Command1_Click()

If Command1.Tag = "" Then
Command1.Tag = "1"
Else
MsgBox "有被人按过"
End If

End Sub

Follow Ups: