VB如何禁用和激活按钮?详细请看内容,在线等答案
我的情况是这样的:在窗体中有 2个按钮 Com1 和Com 2
在窗体加载时,Com2是禁用(灰色)状态,当单击按钮1(com1)时,按钮1变为禁用,同时,按钮2变为可用!
希望大侠们把完整的操作过程及代码写清楚,我是初学者,如果写的不详细,即使偶看到,也不一定能操作出来,先谢谢了`
-----------------
别外,本人诚心找一个VB老师,本人QQ:408282646 --------------------编程问答--------------------
--------------------编程问答-------------------- 谢谢你,功能已经实现了!能不能更完美一点,比如这样:
Private Sub Command1_Click()
Command1.Enabled = False
Command2.Enabled = True
End Sub
Private Sub Command2_Click()
Command2.Enabled = False
Command1.Enabled = True
End Sub
Private Sub Form_Load()
Command2.Enabled = False
End Sub
窗体加载时只显示按钮1,不显示按钮2
当单击按钮1时,按钮1消失,在按钮1的位置显示按钮2
能不能实现?? --------------------编程问答--------------------
--------------------编程问答-------------------- 楼上下解
Private Sub Command1_Click()
With Command1
.Visible = False
Command2.Move .Left, .Top
End With
Command2.Visible = True
End Sub
Private Sub Command2_Click()
With Command2
.Visible = False
Command1.Move .Left, .Top
End With
Command1.Visible = True
End Sub
Private Sub Form_Load()
Command2.Visible = False
End Sub
其实多看看控件的属性就什么都清楚了。 --------------------编程问答-------------------- 一个按钮就行了啊 --------------------编程问答-------------------- Private Sub Command1_Click()
Command1.visible = False
Command2.visible = True
End Sub
Private Sub Command2_Click()
Command2.visible = False
Command1.visible = True
End Sub
Private Sub Form_Load()
Command1.visible = true
Command2.visible = False
End Sub
--------------------编程问答-------------------- 多看看控件的属性
补充:VB , 基础类