哦,是小数点后两位啊? 可以这样写:
Private Sub Text1_Change()
If mid(text1.text,len(text1.text),1)="." then
SendKeys "{TAB}"
end if
设置 Tabindex没有次序难道不能自己设置吗? 设置TabIndex是一定要的。谁能保证自己的软件从头到尾都能按顺序放置控件? 用Text2.SetFocus的话,如果你有100个Textbox那怎么办? 一个个写? 如果是我,我就不写了。
Private Sub Text1_KeyUp(KeyCode As Integer, Shift As Integer)
Dim ls_text As String
Dim li_pos As Integer
ls_text = Text1.Text
li_pos = InStr(ls_text, ".")
If Len(ls_text) - li_pos >= 2 And li_pos <> 0 Then
Text2.SetFocus
End If