17248.html

来自「VB技巧问答10000例,是一个教程」· HTML 代码 · 共 23 行

HTML
23
字号
<html>  <head>    <title>Re: textbox 往上一格或下一格的问题~~~非常紧急啊</title>  </head>  <body bgcolor="#FFFFFF" vlink="#808080">    <center>      <h1>Re: textbox 往上一格或下一格的问题~~~非常紧急啊</h1>    </center><hr size=7 width=75%><hr size=7 width=75%><p>Posted by <a href="mailto:luo570@ms31.hinet.net">小琳</a> on August 14, 1999 at 14:47:28:<p>In Reply to: <a href="17244.html">textbox 往上一格或下一格的问题~~~非常紧急啊</a> posted by 想得快急死了的人 on August 14, 1999 at 14:07:49:<p>: hi~<br>: 各位救救我吧...<br>: 我在form中共有24个textbox<br>: 但其中我只想让它在1-8个textbox跳<br>: 也就是按[ENTER]时,往前跳<br>: 按[-]号时往后跳<br>: 但在textbox(8)时,按[ENTER]要跳回第一格textbox(1)<br>: 我知道往前跳可用sendkeys "{TAB}"<br>: 往回跳sendkeys "+{TAB}"<br>: 可是不知道怎么写才能控制它在我规定的范围跳????<br>: 谢谢~~~~<p>:::您可以使用将那8个Textbox设定成一个物件阵列,另外<br>的Textbox则设定成另外一个物件阵列,程式如下:<br>Dim temp As Integer<p>Private Sub Form_Load()<br>    temp = 0<br>End Sub<p>Private Sub Text1_KeyPress(Index As Integer, KeyAscii As Integer)<br>    If KeyAscii = 13 Then<br>        If temp = 4 Then<br>            temp = 0<br>        Else<br>            temp = temp + 1<br>        End If<br>        Text1(temp).SetFocus<br>    End If<br>    <br>End Sub<br><br><br><hr size=7 width=75%><p><a name="followups">Follow Ups:</a><br><ul><!--insert: 17248--></ul><!--end: 17248--><br><hr size=7 width=75%><p></body></html>

⌨️ 快捷键说明

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