在窗体上放一个text和一个label
当在text选中文字从右向左移动时在label上按从右到左显示选中字符,代码可以显示,但必须要慢点的选中移动 如果快速向左移动就只能显示一部分了,求教下为什么这样
Private ox As Single, oy As Single, a$, b As Integer Private Sub Text1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
ox = X: oy = Y
b = 0
End Sub Private Sub Text1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
If X < ox And Len(Text1.SelText) > b Then 'if左移且有内容
a = Left$(Text1.SelText, 1)
Label1.Caption = Label1.Caption & a
b = Len(Text1.SelText)
End If
End Sub
当在text选中文字从右向左移动时在label上按从右到左显示选中字符,代码可以显示,但必须要慢点的选中移动 如果快速向左移动就只能显示一部分了,求教下为什么这样
Private ox As Single, oy As Single, a$, b As Integer Private Sub Text1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
ox = X: oy = Y
b = 0
End Sub Private Sub Text1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
If X < ox And Len(Text1.SelText) > b Then 'if左移且有内容
a = Left$(Text1.SelText, 1)
Label1.Caption = Label1.Caption & a
b = Len(Text1.SelText)
End If
End Sub