VB 单击 再单击

来源:百度知道 编辑:UC知道 时间:2024/09/22 11:21:37
有一个Command1,一个Label1,已经设置正常情况下Label1显示为:朋友
怎样实现:单击Command1,Label1的内容就自动改为:你好。再单击一次,又变回原来的内容:朋友。
Private Sub Command1_Click()
Label1.Caption = "你好"
End Sub

Private Sub Command1_Click()
if label1.Caption="朋友" then
Label1.Caption = "你好"
else
Label1.Caption = "朋友"
end if
End Sub

Private Sub Form_Load()
Label1.Caption = "朋友"
End Sub

Private Sub Command1_Click()
If Label1.Caption = "朋友" Then
Label1.Caption = "你好"
Else
Label1.Caption = "朋友"
End If
End Sub

是不是这个意思????