Private bln As Boolean Private Sub Command1_Click() bln = False Text1.Text = "abc" bln = True End SubPrivate Sub Text1_Change() If Not bln Then Exit Sub MsgBox Text1.Text End Sub
听懂了; 在 失去焦点事件中加你的代码.Private Sub Text1_LostFocus() MsgBox Text1.Text End Sub要求结帐!
Private Sub Command1_Click()
bln = False
Text1.Text = "abc"
bln = True
End SubPrivate Sub Text1_Change()
If Not bln Then Exit Sub
MsgBox Text1.Text
End Sub
在 失去焦点事件中加你的代码.Private Sub Text1_LostFocus()
MsgBox Text1.Text
End Sub要求结帐!
--------------------------------------
直接在text1_KeyPress事件中处理.
VB编程要讲究自然,心里想什么就写什么.
改用keypress 或者keyup事件比较好