一个VB问题 Private Sub Text1_KeyPress(KeyAscii As Integer) Dim char As String
PrivateSubText1_KeyPress(KeyAsciiAsInteger)DimcharAsStringchar=Chr(KeyAscii)KeyAscii=...
Private Sub Text1_KeyPress(KeyAscii As Integer)
Dim char As String
char = Chr(KeyAscii)
KeyAscii = Asc(LCase(char))
Text1.Text = String(6, KeyAscii)
End Sub
为啥打一个字母进去,文本框最终结果会显示7个?而我在其中添加Print String(6, KeyAscii)进去后,窗体显示的是六个字母,文本框依然是七个,有谁可以帮忙解答一下捏? 展开
Dim char As String
char = Chr(KeyAscii)
KeyAscii = Asc(LCase(char))
Text1.Text = String(6, KeyAscii)
End Sub
为啥打一个字母进去,文本框最终结果会显示7个?而我在其中添加Print String(6, KeyAscii)进去后,窗体显示的是六个字母,文本框依然是七个,有谁可以帮忙解答一下捏? 展开
3个回答
2013-04-03
展开全部
你打的那一个不用算吗?KeyAscii = Asc(LCase(char))这句只会影响打进去字符的大小写,而不会影响他的输出,如果你想只输出六个可以改为
Private Sub Text1_KeyPress(KeyAscii As Integer)
Dim char As String
char = Chr(KeyAscii)
KeyAscii = Asc(LCase(char))
Text1.Text = String(6, KeyAscii)
KeyAscii = 0
End Sub
Private Sub Text1_KeyPress(KeyAscii As Integer)
Dim char As String
char = Chr(KeyAscii)
KeyAscii = Asc(LCase(char))
Text1.Text = String(6, KeyAscii)
KeyAscii = 0
End Sub
展开全部
Private Sub Text1_KeyPress(KeyAscii As Integer)
Dim char As String
char = Chr(KeyAscii)
KeyAscii = Asc(LCase(char))
Text1.Text = String(6, KeyAscii)
KeyAscii = 0 '增加这一句,就不会显示你按下的字符
End Sub
Dim char As String
char = Chr(KeyAscii)
KeyAscii = Asc(LCase(char))
Text1.Text = String(6, KeyAscii)
KeyAscii = 0 '增加这一句,就不会显示你按下的字符
End Sub
本回答被网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
Text1.Text = String(6, KeyAscii) 输出了6个,加上你按的1个,不就有7个了吗
Print String(6, KeyAscii) 输出了6个就是6个了
Print String(6, KeyAscii) 输出了6个就是6个了
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询