|
-
Jul 15th, 2000, 03:32 PM
#1
Thread Starter
New Member
I have a multiline textbox. Selecting text in it with mouse causes the selected text to go blue, but selecting it with code like this
Text10.SelStart = under
Text10.SelLength = over - under
Clipboard.Clear
Clipboard.SetText Text10.SelText
while it goes to clipboard fine, doesn't make it go blue. I'd like it to go blue when selected in code. Any thoughts?
Thanks
-
Jul 15th, 2000, 03:50 PM
#2
Use the SetFocus method.
Code:
Text1.SelStart = 5
Text1.SelLength = 10
Text1.SetFocus
-
Jul 15th, 2000, 03:51 PM
#3
Thread Starter
New Member
Forget the question! just realised I needed to set the focus
thanks
-
Jul 15th, 2000, 04:00 PM
#4
SetFocus is better, but I didn't write this code for nothing ;].
Code:
Private Sub Text1_GotFocus()
Dim T As Long
T = Len(Text1.Text)
Text1.SelStart = 0
Text1.SelLength = T
End Sub
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|