1892.html

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

HTML
22
字号
<html>  <head>    <title>Re: 请问有关游标驻点问题</title>  </head>  <BODY BACKGROUND="" BGCOLOR="white" TEXT="black" LINK="red" VLINK="#808080" ALINK="">    <center>      <h1>Re: 请问有关游标驻点问题</h1>    </center><HR><p>Posted by <a href="mailto:a338479@ms3.hinet.net">小刘</a> on February 08, 1998 at 22:13:39:<p>In Reply to: <a href="1888.html"><b>请问有关游标驻点问题</b></a> posted by 阿东 on February 08, 1998 at 19:31:57:<p>: Private Sub Form_Load()<br>: Text1.SetFocus**********为何错误<br>: End Sub<br>其实这个不用设,只要 Text1 的属性 TabIndex 把它设成 0 自然就会<br>启动了,如果一定要设的话,就要设在 Form_Activate()<p>: Private Sub Text1_KeyPress(KeyAscii As Integer)<br>: '当key in 第一个字母时就开始判断<br>: If Len(Text1) = 0 Then<br>:     '当TEXT1.TEXT=* 时就游标出现在TEXT2但确没有<br>:     If Left(Text1, 1) = "*" Then<br>:         Text2.SetFocus<br>:     End If<br>:     '当TEXT1.TEXT=0  游标出现在COMMAND1上但确没有<br>:     If Left(Text1, 1) = "0" Then<br>:        Command1.SetFocus<br>:     End If<br>: End If<br>: End Sub<br>这个问题,参考下面的内容<br>Private Sub Text1_KeyPress(KeyAscii As Integer)<p>If KeyAscii = 42 Then Command1.SetFocus '*<br>If KeyAscii = 48 Then Text2.SetFocus '0<p>End Sub<br><br><p><a name="followups">Follow Ups:</a><br><ul><!--insert: 1892--></ul><!--end: 1892--><br><HR><p></body></html>

⌨️ 快捷键说明

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