17738.html

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

HTML
23
字号
<html>  <head>    <title>Re: 请问 : textbox 中有没有方法 or 能不能做到 (详内)</title>  </head>  <body bgcolor="#FFFFFF" vlink="#808080">    <center>      <h1>Re: 请问 : textbox 中有没有方法 or 能不能做到 (详内)</h1>    </center><hr size=7 width=75%><hr size=7 width=75%><p>Posted by dino on August 23, 1999 at 18:51:42:<p>In Reply to: <a href="17718.html">请问 : textbox 中有没有方法 or 能不能做到 (详内)</a> posted by Albert Chiu ~~~~ on August 23, 1999 at 13:18:40:<p>每碰到"好"...会以方框代替<p>Private Sub Text1_Change()<p>strTarget = "好"<br>strReplace = "□"<p>If InStr(1, Text1.Text, strTarget) <> 0 Or not isnull(InStr(1, Text1.Text, strTarget)) Then<br>   <br>   If Text1.SelStart < Len(Text1.Text) Then<br>    i = Text1.SelStart<br>    Text1.Text = Mid(Text1.Text, 1, CLng(Text1.SelStart - 1)) & strReplace & Mid(Text1.Text, CLng(Text1.SelStart + 1))<br>    Text1.SelStart = i<br>   Else<br>    Text1.Text = Left(Text1.Text, Len(Text1.Text) - 1) & strReplace<br>    Text1.SelStart = Len(Text1.Text)<br>   End If<br>   <br>End If<p>End Sub<br><br><br><hr size=7 width=75%><p><a name="followups">Follow Ups:</a><br><ul><!--insert: 17738--></ul><!--end: 17738--><br><hr size=7 width=75%><p></body></html>

⌨️ 快捷键说明

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