7,788
社区成员
发帖
与我相关
我的任务
分享Option Explicit
Private txtLen As Long
Private Sub Form_Load()
txtLen = Len(RichTextBox1.Text)
End Sub
Private Sub RichTextBox1_Change()
Dim p&, i&, lLen&, strTemp$
p = RichTextBox1.SelStart
lLen = Len(Me.RichTextBox1.Text)
i = lLen - txtLen
If (i > 0) Then
strTemp = RichTextBox1.Text
For txtLen = p - i + 1 To p
If (Mid$(strTemp, txtLen, 1) = "一") Then Mid$(strTemp, txtLen, 1) = "五"
Next
RichTextBox1.Text = strTemp
RichTextBox1.SelStart = p
End If
txtLen = lLen
End SubRichTextBox1.Text =replace(RichTextBox1.Text ,"一","五")