VB Check 控制按钮的激活状态
窗体启动时:
按钮1、按钮2、按钮3,处于激活状态,
按钮4、按钮5、处于未激活状态。
当点击Check1按钮时(True)时,
按钮1、按钮2、按钮3,处于未激活状态,
按钮4、按钮5、处于激活状态。
当点击Check1按钮时(False)时,
按钮1、按钮2、按钮3,处于激活状态,
按钮4、按钮5、处于未激活状态。
以下是程序代码,不知道为什么,就是实现不了,请指教,谢谢!
程序代码:
Private Sub Check1_KeyPress(KeyAscii As Integer) With Me .Command1.Enabled = False .Command2.Enabled = False .Command3.Enabled = False .Command4.Enabled = True .Command5.Enabled = True End With End Sub Private Sub Command1_Click() MsgBox "按钮1", 64 + 0, "提醒" End Sub Private Sub Command2_Click() MsgBox "按钮2", 64 + 0, "提醒" End Sub Private Sub Command3_Click() MsgBox "按钮3", 64 + 0, "提醒" End Sub Private Sub Command4_Click() MsgBox "按钮4", 64 + 0, "提醒" End Sub Private Sub Command5_Click() MsgBox "按钮5", 64 + 0, "提醒" End Sub Private Sub Command6_Click() Unload Me End Sub Private Sub Form_Load() Me.Command4.Enabled = False Me.Command5.Enabled = False End Sub