展开全部
先把command1属性窗口中的Style设为1,否则不能改变按钮颜色。
Command1.BackColor默认绿色
Option Explicit
Dim cFT As Long
Private Sub Command1_Click()
If cFT = 0 Then
Command1.BackColor = vbRed
cFT = 1
ElseIf cFT = 1 Then
Command1.BackColor = vbRed
cFT = 2
ElseIf cFT = 2 Then
Command1.BackColor = vbGreen
cFT = 0
End If
End Sub
Command1.BackColor默认绿色
Option Explicit
Dim cFT As Long
Private Sub Command1_Click()
If cFT = 0 Then
Command1.BackColor = vbRed
cFT = 1
ElseIf cFT = 1 Then
Command1.BackColor = vbRed
cFT = 2
ElseIf cFT = 2 Then
Command1.BackColor = vbGreen
cFT = 0
End If
End Sub
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询