文件名称:vbinputtext
-
所属分类:
- 标签属性:
- 上传时间:2014-05-05
-
文件大小:1.63kb
-
已下载:0次
-
提 供 者:
-
相关连接:无下载说明:别用迅雷下载,失败请重下,重下不扣分!
介绍说明--下载内容来自于网络,使用问题请自行百度
VB只只允许输入汉字,输入其它字符无效,输入中文的时候程序好像什么也没做,但是当你的输入法不是中文状态,即将要输入英文或其它字符的时候,会立即弹出一个提示框,告诉你只允许输入中文,在不少的VB应用中,进行输入字符类型的限制是必需的,这样可有效提升输入质量。实现时候的关键代码:
Private Sub Text1_KeyPress(KeyAscii As Integer)
If KeyAscii > 0 And KeyAscii <> 13 And KeyAscii <> 8 Then
KeyAscii = 0
MsgBox "只允许输入汉字!", 48, "提示"
End If
End Sub-VB only allows only the input of Chinese characters, other characters enter invalid input Chinese when the program seems to do nothing, but when you enter the state law is not Chinese, English or about to enter when other characters will immediately pop up a message box, you are only allowed to enter the Chinese told in many VB applications, the input character type of restriction is necessary, which can effectively improve the quality of the input. Achieved when the key code:
Private Sub Text1_KeyPress (KeyAscii As Integer)
If KeyAscii> 0 And KeyAscii <> 13 And KeyAscii <> 8 Then
KeyAscii = 0
MsgBox "only allowed to input Chinese characters!", 48, "prompt"
End If
End Sub
Private Sub Text1_KeyPress(KeyAscii As Integer)
If KeyAscii > 0 And KeyAscii <> 13 And KeyAscii <> 8 Then
KeyAscii = 0
MsgBox "只允许输入汉字!", 48, "提示"
End If
End Sub-VB only allows only the input of Chinese characters, other characters enter invalid input Chinese when the program seems to do nothing, but when you enter the state law is not Chinese, English or about to enter when other characters will immediately pop up a message box, you are only allowed to enter the Chinese told in many VB applications, the input character type of restriction is necessary, which can effectively improve the quality of the input. Achieved when the key code:
Private Sub Text1_KeyPress (KeyAscii As Integer)
If KeyAscii> 0 And KeyAscii <> 13 And KeyAscii <> 8 Then
KeyAscii = 0
MsgBox "only allowed to input Chinese characters!", 48, "prompt"
End If
End Sub
(系统自动生成,下载前可以参看下载内容)
下载文件列表
只允许输入汉字/Form1.frm
只允许输入汉字/MSSCCPRJ.SCC
只允许输入汉字/工程1.vbp
只允许输入汉字/工程1.vbw
只允许输入汉字
只允许输入汉字/MSSCCPRJ.SCC
只允许输入汉字/工程1.vbp
只允许输入汉字/工程1.vbw
只允许输入汉字
本网站为编程资源及源代码搜集、介绍的搜索网站,版权归原作者所有! 粤ICP备11031372号
1999-2046 搜珍网 All Rights Reserved.