Link to home
Start Free TrialLog in
Avatar of isnoend2001
isnoend2001Flag for United States of America

asked on

VB 6 textbox select start

I have a textbox that contains text and want to paste text after the text it contains with 1 space.
this does not work:
Private Sub txtDescription_Click()
txtDescription.SelStart = 0
txtDescription.SelText = Len(txtDescription.Text)
txtDescription.SelStart = Len(txtDescription.SelText) + 1
End Sub
what is wrong ?
Avatar of Guru Ji
Guru Ji
Flag of Canada image

You can do something like this to your text

txtDescription.SelText = Replace(txtDescription.Text, " ", "")


This will get rid of any space.
Avatar of isnoend2001

ASKER

No I want to add a space and  paste text to the end of the existing text
ASKER CERTIFIED SOLUTION
Avatar of Mike Tomlinson
Mike Tomlinson
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks this works:
someStringVariable needs to be the clipboard contents
txtDescription.Text = txtDescription.Text & " "
txtDescription.SelStart = Len(txtDescription.Text) + 1