文件名称:vbinputtext
- 所属分类:
- Windows编程
- 资源属性:
- [Windows] [Visual C] [Basic/ASP] [源码]
- 上传时间:
- 2014-05-05
- 文件大小:
- 2kb
- 下载次数:
- 0次
- 提 供 者:
- cpu****
- 相关连接:
- 无
- 下载说明:
- 别用迅雷下载,失败请重下,重下不扣分!
介绍说明--下载内容均来自于网络,请自行研究使用
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
只允许输入汉字