|
-
Oct 28th, 2009, 11:33 PM
#1
Thread Starter
Hyperactive Member
[RESOLVED] Textbox how do I invert-select the text?
Hi, can anyone please help me on this. I have no idea of how I would code it to select a text in a textbox BUT the cursor must end at the selstart position. How do I do this?? Please help me.. Thanks a lot!
PS: I attached the screenshots for both the unwanted and wanted condition.
-
Oct 29th, 2009, 02:44 AM
#2
Re: Textbox how do I invert-select the text?
this may do ur wish, add a cmd butn and textbox
Code:
Private Sub Command1_Click()
Text1.SetFocus
Text1.SelStart = 10 'starting position
SendKeys "+{LEFT 5}" 'shift + left arrow 5 times
End Sub
-
Oct 29th, 2009, 03:03 AM
#3
Re: Textbox how do I invert-select the text?
Code:
Private Sub Form_Load()
Dim MyArray() As String, i As Integer, j As Integer
'~~> Sample Text
Text1.Text = "Testing Words"
'~~> Split Text "space" as delimiter
MyArray = Split(Text1.Text, " ")
'~~> Moving the cursor to the end of the text
Text1.SelStart = Len(Text1.Text)
'~~> Deciding the number of Chars to move backwards
j = Len(MyArray(UBound(MyArray)))
'~~> Move backwards...
For i = 1 To j
SendKeys "+{Left}"
Next i
End Sub
Edit: Damn... I am late... seenu_1st has already replied...
A good exercise for the Heart is to bend down and help another up...
Please Mark your Thread " Resolved", if the query is solved
MyGear:
★ CPU ★ Ryzen 5 5800X
★ GPU ★ NVIDIA GeForce RTX 3080 TI Founder Edition
★ RAM ★ G. Skill Trident Z RGB 32GB 3600MHz
★ MB ★ ASUS TUF GAMING X570 (WI-FI) ATX Gaming
★ Storage ★ SSD SB-ROCKET-1TB + SEAGATE 2TB Barracuda IHD
★ Cooling ★ NOCTUA NH-D15 CHROMAX BLACK 140mm + 10 of Noctua NF-F12 PWM
★ PSU ★ ANTEC HCG-1000-EXTREME 1000 Watt 80 Plus Gold Fully Modular PSU
★ Case ★ LIAN LI PC-O11 DYNAMIC XL ROG (BLACK) (G99.O11DXL-X)
★ Monitor ★ LG Ultragear 27" 240Hz Gaming Monitor
★ Keyboard ★ TVS Electronics Gold Keyboard
★ Mouse ★ Logitech G502 Hero
-
Oct 29th, 2009, 03:50 AM
#4
Thread Starter
Hyperactive Member
Re: Textbox how do I invert-select the text?
Oh my greatness! Just that easy! Hey thanks guys
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
|