⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 19480.html

📁 VB技巧问答10000例 VB技巧问答10000例
💻 HTML
字号:
<html>  <head>    <title>建议</title>  </head>  <body bgcolor="#FFFFFF" vlink="#808080">    <center>      <h1>建议</h1>    </center><hr size=7 width=75%><hr size=7 width=75%><p>Posted by <a href="mailto:subird@ms20.url.com.tw">SuBird</a> on September 30, 1999 at 09:18:44:<p>In Reply to: <a href="19472.html">Re: 如何转换setfocus</a> posted by Buier on September 30, 1999 at 01:58:31:<p>: : 请问我目前有四个text<br>: : txt1,txt2.txt3,txt4<p>: : 如何做才能在txt1按enter时游标停在txt2上<br>: : 在txt2按enter时游标停在txt3上<br>: : 以此类推呢?<p>: : 以上是我的程式内容,请问错在哪里呢?<br>: : 请各位高手帮帮忙。<br>: 你的程式应该没错,你可以试下面的程式看看(两个textbox).<br>: Private Sub Text1_KeyPress(KeyAscii As Integer)<br>:   Form1.Caption = KeyAscii<br>:   If KeyAscii = 13 Then<br>:     Text2.SetFocus<br>:   End If<br>: End Sub<br>: Private Sub Text2_KeyPress(KeyAscii As Integer)<br>:   Form1.Caption = KeyAscii<br>:   If KeyAscii = 13 Then<br>:     Text1.SetFocus<br>:   End If<br>: End Sub<p>Re:<br>1)同控制项尽量以阵列型式新增,ex. Text1(0),Text(1).....<br>2)如此上式可简略成<br>Private Sub Text1_KeyPress(Index As Integer, KeyAscii As Integer)<br>    If KeyAscii = 13 Then  'Enter的Ascii code<br>        SendKeys "{tab}"   '送一tab键<br>        KeyAscii = 0       '再将按键取消<br>    End If<br>End Sub<br>其中每个TextBox的TabIndex按顺序排列即可。<br>若要让按键往前跳则改为 SendKeys "+{tab}".<br><br><hr size=7 width=75%><p><a name="followups">Follow Ups:</a><br><ul><!--insert: 19480--></ul><!--end: 19480--><br><hr size=7 width=75%><p></body></html>

⌨️ 快捷键说明

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