1个回答
展开全部
Dim oc As Long
Private Sub Command1_Click()
Command1.BackColor = vbRed
End Sub
Private Sub Command2_Click()
Command1.BackColor = oc
End Sub
Private Sub Form_Load()
Command1.Caption = "变为红色"
Command2.Caption = "恢复原色"
oc = Command1.BackColor
End Sub
以上代码涉及两个按钮:Command1和Command2,其中Command1的Style属性要设为1
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询