在VB中,怎样做才能使按钮单击一次,按钮名称显示为A,再单击显示B,如此在A,B间循环?请各位高手指点... 20
在VB中,怎样做才能使按钮单击一次,按钮名称显示为A,再单击显示B,如此在A,B间循环?请各位高手指点,给出代码!...
在VB中,怎样做才能使按钮单击一次,按钮名称显示为A,再单击显示B,如此在A,B间循环?请各位高手指点,给出代码!
展开
展开全部
楼上搞错了好像,应该把事件写在Command的Click()事件里面
Private Sub Command1_Click()
If Command1.Caption = "A" Then
Command1.Caption = "B"
ElseIf Command1.Caption = "B" Then
Command1.Caption = "A"
Else
Command1.Caption = "A"
End If
End Sub
Private Sub Command1_Click()
If Command1.Caption = "A" Then
Command1.Caption = "B"
ElseIf Command1.Caption = "B" Then
Command1.Caption = "A"
Else
Command1.Caption = "A"
End If
End Sub
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
'放置一个按钮,把按钮的名称改为command1
Private Sub Command1_Click()
If Command1.Caption = "A" Then
Command1.Caption = "B"
Else
Command1.Caption = "A"
End if
end sub
Private Sub Command1_Click()
If Command1.Caption = "A" Then
Command1.Caption = "B"
Else
Command1.Caption = "A"
End if
end sub
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
在button1_click事件写:
if button1.caption="A" Then
button1.caption="B"
else
button1.caption="A"
end if
if button1.caption="A" Then
button1.caption="B"
else
button1.caption="A"
end if
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
Private Sub Form_Load()
If Command1.Caption = "A" Then
Command1.Caption = "B"
ElseIf Command1.Caption = "B" Then
Command1.Caption = "A"
Else
Command1.Caption = "A"
End If
End Sub
If Command1.Caption = "A" Then
Command1.Caption = "B"
ElseIf Command1.Caption = "B" Then
Command1.Caption = "A"
Else
Command1.Caption = "A"
End If
End Sub
本回答被网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询