VB程序如下,当文本框有焦点时,正常, 当文本框失去焦点时,文本框不能捕捉按键,请问怎么改?
DimaAsStringPrivateSubForm_KeyPress(KeyAsciiAsInteger)IfKeyAscii=13ThenText1.Text=Tex...
Dim a As String
Private Sub Form_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Text1.Text = Text1.Text + a + vbCrLf
a = ""
Else
a = a + Chr(KeyAscii)
End If
End Sub
Private Sub Command1_KeyPress(KeyAscii As Integer)
KeyPress(KeyAscii)
End Sub
加上上面的程序也不行! 展开
Private Sub Form_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Text1.Text = Text1.Text + a + vbCrLf
a = ""
Else
a = a + Chr(KeyAscii)
End If
End Sub
Private Sub Command1_KeyPress(KeyAscii As Integer)
KeyPress(KeyAscii)
End Sub
加上上面的程序也不行! 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询