3292.html

来自「以电子书的形式收集了VB一些常见问题解决方法,可以很方便的查找自己需要解决的问题」· HTML 代码 · 共 26 行

HTML
26
字号
<html>
  <head>
    <title>Re: 在一个textbox中, 如何判断输入的是字元或数字呢?</title>
  </head>
  <BODY BACKGROUND="" BGCOLOR="white" TEXT="black" LINK="red" VLINK="#808080" ALINK="">
    <center>
      <h1>Re: 在一个textbox中, 如何判断输入的是字元或数字呢?</h1>
    </center>

<HR><p>
Posted by <a href="mailto:meteor@bbs.yuntech.edu.tw">meteor</a> on June 17, 1998 at 07:51:35:<p>
In Reply to: <a href="3287.html"><b>Re: 在一个textbox中, 如何判断输入的是字元或数字呢?</b></a> posted by 纪文和 on June 17, 1998 at 05:46:33:<p>
: 假设该栏位是 Text1,则<p>: Private Sub Text1_KeyUp(KeyCode As Integer, Shift As Integer)<br>: __If Len(Text1) = 1 Then<br>: ____If Asc(UCase$(Text1))  90 Then<br> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br>                  这边该用什么判断式呢?因如不用则会错误<p>: ______MsgBox "只能输入 A.B.C.D..."<br>: ____Text1 = ""<br>: ____End If<br>: __End If<br>: __If Len(Text1) > 1 Then<br>: ____If Asc(Mid(Text1, Len(Text1), 1))  57 Then<br>~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br>                                   这边也一样说!          <p>: ______MsgBox "只能输入数字"<br>: ______Text1 = Left(Text1, Len(Text1) - 1)  '移除错误字元,可是游标会跑到最前面<br>: ______Text1.SelStart = Len(Text1)              '将游标移到最后面,以方便 user 继续输入<br>: ____End If<br>: __End If<br>: End Sub<p><br>
<br>
<p>
<a name="followups">Follow Ups:</a><br>
<ul><!--insert: 3292-->
<!--top: 3293--><li><a href="3293.html"><b>Re: 在一个textbox中, 如何判断输入的是字元或数字呢? .....正确</b></a> 纪文和 <i>09:16:44 6/17/98</i>
(<!--responses: 3293-->0)
<ul><!--insert: 3293-->
</ul><!--end: 3293-->
</ul><!--end: 3292-->
<br><HR><p>

</body></html>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?