vb中输入一个ascii字符,输出前导字符和后续字符
如题,在text1中输入一个字符,在text2中输出前导字符,text3中输出后续字符,在keypress事件中进行。在keyup中编写过程使在text1中输入字符立刻选...
如题,在text1中输入一个字符,在text2中输出前导字符,text3中输出后续字符,在keypress事件中进行。在keyup中编写过程使在text1中输入字符立刻选中它
展开
4个回答
展开全部
Private Sub Text1_KeyPress(KeyAscii As Integer)
Label4.Caption = Chr(KeyAscii - 1)
Label5.Caption = Chr(KeyAscii + 1)
End Sub
Private Sub Text1_KeyUp(KeyCode As Integer, Shift As Integer)
Text1.SetFocus
Text1.SelStart = 0
Text1.SelLength = 1
End Sub
Label4.Caption = Chr(KeyAscii - 1)
Label5.Caption = Chr(KeyAscii + 1)
End Sub
Private Sub Text1_KeyUp(KeyCode As Integer, Shift As Integer)
Text1.SetFocus
Text1.SelStart = 0
Text1.SelLength = 1
End Sub
本回答被提问者和网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
Private Sub Text1_KeyPress(KeyAscii As Integer)
Text2.Text = Chr$(KeyAscii - 1)
Text3.Text = Chr$(KeyAscii + 1)
Text4.Text = (KeyAscii)
End Sub
Text2.Text = Chr$(KeyAscii - 1)
Text3.Text = Chr$(KeyAscii + 1)
Text4.Text = (KeyAscii)
End Sub
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询