Private Sub Command1_Click()
Dim x As Integer
If x = 1 Then
Text1.Locked = True
Text2.Locked = True
End If
End Sub本人想利用单击Command1 来控制Text1和Text2的输入.我想要实现的功能:体是当我第一次单击Command1时,实现Text1不能输入,Text2可以输入.当我第二次单击Command1时,实现Text1能输入,Text2不能输入,当第三次单击Command1时,Text1和Text2都不能输入!
Dim x As Integer
If x = 1 Then
Text1.Locked = True
Text2.Locked = True
End If
End Sub本人想利用单击Command1 来控制Text1和Text2的输入.我想要实现的功能:体是当我第一次单击Command1时,实现Text1不能输入,Text2可以输入.当我第二次单击Command1时,实现Text1能输入,Text2不能输入,当第三次单击Command1时,Text1和Text2都不能输入!
AllowInput=1
end sub
Private Sub Command1_Click()
if AllowInput=1 then
Text1.Enabled=false
Text2.Enabled=true
AllowInput=2
endif
if AllowInput=2 then
Text1.Enabled=true
Text2.Enabled=false
AllowInput=3
endif
if AllowInput=3 then
Text1.Enabled=false
Text2.Enabled=false
AllowInput=1
endif
End Sub
谢谢chenjl1031 和jms918 的帮助
Private Sub Command1_Click()
if a=0 then
text1.locked=true
text2.locked=false
a=1
elseif a=1 then
text1.locked=false
text2.locked=true
a=0
end if
End Sub用a变量来判断就行了