个人觉得一个过程好控制些
而且text1.selstart应为0而不是1
Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
Private Sub Command1_Click()
Dim l As Long
l = 0
Text1.SetFocus
Text1.SelStart = 0
Do While l <= Len(Text1) - Text1.SelStart
Text1.SelLength = l
l = l + 1
DoEvents
Sleep 50 '延时50毫秒
Loop
End Sub
难得你想实现按键精灵的效果?
用API mouse_event和 getwindowrect
建一个timer
模拟
Private Sub Timer1_Timer()
Text1.SelStart = 1
For i = 1 To Len(Text1)
Text1.SelLength = i
Next i
End Sub
速度由timer的interval决定
Text1.SelStart = 0
Text1.SelLength =len(Text1)