11031.html

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

HTML
23
字号
<html>
  <head>
    <title>Re: 急件..请问两个问题</title>
  </head>
  <body bgcolor="#FFFFFF" vlink="#808080">
    <center>
      <h1>Re: 急件..请问两个问题</h1>
    </center>
<hr size=7 width=75%>

<hr size=7 width=75%><p>
Posted by Mouse on March 16, 1999 at 23:42:28:<p>
In Reply to: <a href="11009.html">急件..请问两个问题</a> posted by sdy on March 16, 1999 at 16:11:55:<p>
: 请问怎么判断text中的值.(只想使用者输入数值)<br>: 如果出现英文字或中文字..则会出警告讯息.并将text里清成空白<br>: 另外..<br>: 如果两个text中都有数值了<br>: 要让一个command.enabled=true,该怎么判断.要写在那边呢?<br>: (还没有值之前.command.enabled=false)<br>: 请各位高手帮我解答..谢谢~~<p>第一个问题可以用isnumeric()来测试是否为数字<br>private sub Text_keypress(keyascii as integer)<br>if keyascii=vbkeyreturn then<br>   if isnumeric(text.text) then '为数字<br>       SendKeys "{tab}"<br>   else<br>       msgbox "不是数字"<br>       text.text=""<br>   end if<br>end if<br>end sub<p>第二个问题<br>private sub text1_chang()<br>   if isnumeric(text1.text) and isnumeric(text2.text) then<br>       command1.enabled=true<br>   else<br>       command1.enabled=false<br>   end if<br>end sub<br>private sub text2_chang()<br>   if isnumeric(text1.text) and isnumeric(text2.text) then<br>       command1.enabled=true<br>   else<br>       command1.enabled=false<br>   end if<br>end sub
<br>
<br><hr size=7 width=75%><p>
<a name="followups">Follow Ups:</a><br>
<ul><!--insert: 11031-->
</ul><!--end: 11031-->
<br><hr size=7 width=75%><p>

</body></html>

⌨️ 快捷键说明

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