VB6.0 怎样使多个textbox有顺序的输入
比如让text1输入完了回车切到text3,然后到text5,4,2,总之就是可以自己设定顺序...
比如让text1输入完了回车切到text3,然后到text5,4,2,总之就是可以自己设定顺序
展开
1个回答
展开全部
先将除text1以外的其他textbox的enable设置为false,然后再逐个对textbox的keypress事件进行处理,将相应的textbox的enable设置为true
追问
keypress怎么弄的啊
追答
Private Sub Form_Load()
Text1.Enabled = True
Text2.Enabled = False
Text3.Enabled = False
Text4.Enabled = False
Text5.Enabled = False
End Sub
Private Sub Text1_KeyPress(KeyAscii As Integer)
If Text1.Text <> "" And KeyAscii = 13 Then
Text3.Enabled = True
End If
End Sub
Private Sub Text3_KeyPress(KeyAscii As Integer)
If Text3.Text <> "" And KeyAscii = 13 Then
Text5.Enabled = True
End If
End Sub
Private Sub Text4_KeyPress(KeyAscii As Integer)
If Text4.Text <> "" And KeyAscii = 13 Then
Text2.Enabled = True
End If
End Sub
Private Sub Text5_KeyPress(KeyAscii As Integer)
If Text5.Text <> "" And KeyAscii = 13 Then
Text4.Enabled = True
End If
End Sub
大概就是上面的意思
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询