2个回答
展开全部
呀,你要实现啥功能哟,你可以换一种思维来想呀,如果输入完不按回车,文本框失去焦点后就显示原来的数字,按回车则显示当前的数字,
Public aa, a, b
Private Sub Text1_GotFocus()
b = Text1.Text
End Sub
Private Sub Text1_LostFocus()
If aa = 1 Then
Text1.Text = a
Else
Text1.Text = b
End If
End Sub
Private Sub Text1_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
a = Text1.Text
aa = 1
Else
aa = 0
End If
End Sub
Public aa, a, b
Private Sub Text1_GotFocus()
b = Text1.Text
End Sub
Private Sub Text1_LostFocus()
If aa = 1 Then
Text1.Text = a
Else
Text1.Text = b
End If
End Sub
Private Sub Text1_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
a = Text1.Text
aa = 1
Else
aa = 0
End If
End Sub
追问
如果是要求文本框输入的是1,回车后显示的是a,2的时候是b又该如何实现呢?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询