Private Sub Form_Load()Command2.Enabled = FalseEnd SubPrivate Sub Command1_Click()Command1.Enabled = FalseCommand2.Enabled = TrueEnd Sub
Private Sub Command2_Click()Command2.Enabled = FalseCommand1.Enabled = TrueEnd Sub
另一个把Enabled 改为Visible就可以了,当然这只是两个按钮变换,如果是更多的按钮就不这样用代码了。