7,763
社区成员
发帖
与我相关
我的任务
分享
Option Explicit
Private Declare Function HideCaret Lib "User32.dll" (ByVal hwnd As Long) As Boolean
Private Sub RichTextBox1_SelChange()
Static isLocked As Boolean
Static l&
If isLocked Then Exit Sub
l = RichTextBox1.SelStart
isLocked = True
RichTextBox1 = Replace(RichTextBox1, "@", "")
If l > 0 Then RichTextBox1.SelStart = l - 1
RichTextBox1.SelText = "@"
isLocked = False
HideCaret RichTextBox1.hwnd
End Sub
Private Declare Function HideCaret Lib "User32.dll" (ByVal hwnd As Long) As Boolean Private Sub Text1_GotFocus()
HideCaret Text1.hwnd
End Sub