1,451
社区成员
发帖
与我相关
我的任务
分享
Option Explicit
Private Sub Command1_Click()
Dim P1 As Long
With RichTextBox1
.SelStart = .Find("YYYWWW")
.SelLength = 0
.SetFocus
SendKeys "^{left}", False
SendKeys "+^{right}", False
End With
Timer1.Enabled = True
End Sub
Private Sub Command2_Click()
With RichTextBox1
Debug.Print Timer, .SelText, .SelStart, .SelLength
End With
End Sub
Private Sub Form_Load()
With RichTextBox1
.Text = "1111111111111111111111111111111111111111111111111111" & vbCrLf & _
"2111111111111111111111111111111111111111111111111111" & vbCrLf & _
"3111111111111111111111111111111111111111111111111111" & vbCrLf & _
"411111111111111111111111111111YYYWWW1111111111111111111111" & vbCrLf & _
"5111111111111111111111111111111111111111111111111111" & vbCrLf & _
"6111111111111111111111111111111111111111111111111111" & vbCrLf & _
"71111111111111111111111111111111111111111111111" & vbCrLf
End With
End Sub
Private Sub Timer1_Timer()
If RichTextBox1.SelText <> "" Then Label1.Caption = Timer & " " & RichTextBox1.SelText
Timer1.Enabled = False
End Sub