Solved

VB 6 textbox select start

Posted on 2015-01-26
4
73 Views
Last Modified: 2015-01-26
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 ?
0
Comment
Question by:isnoend2001
  • 2
4 Comments
 
LVL 11

Expert Comment

by:Guru Ji
ID: 40571007
You can do something like this to your text

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


This will get rid of any space.
0
 

Author Comment

by:isnoend2001
ID: 40571025
No I want to add a space and  paste text to the end of the existing text
0
 
LVL 85

Accepted Solution

by:
Mike Tomlinson earned 500 total points
ID: 40571039
Why not just?

    txtDescription.Text = txtDescription.Text & " " & someStringVariable
0
 

Author Closing Comment

by:isnoend2001
ID: 40571071
Thanks this works:
someStringVariable needs to be the clipboard contents
txtDescription.Text = txtDescription.Text & " "
txtDescription.SelStart = Len(txtDescription.Text) + 1
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now