Solved

How I append texts in a text box?

Posted on 2001-09-10
12
232 Views
Last Modified: 2008-02-01
Suppose, I have a text box, say Text1 and whose 'MULTILINE' property is set 'TRUE'. Is there any method in the Text Box class which can be used to append texts in the Text Box object Text1.

Subhasis.
0
Comment
Question by:mitra_subhasis
  • 5
  • 2
  • 2
  • +3
12 Comments
 
LVL 1

Expert Comment

by:sanjeevjain1973
ID: 6473238
For append use like this

Text1.Text = Text1.Text & "Apended Text"

Means u can concate & old value of text the aggain assign.

Sanjeev
0
 
LVL 75

Accepted Solution

by:
Anthony Perkins earned 10 total points
ID: 6473254
If you want the appended text to go on separate lines than try something like this:

Text1.Text = Text1.Text & vbCR & "New text"
0
 
LVL 1

Expert Comment

by:sanjeevjain1973
ID: 6473269
vbCrLf is combination carrige return & Linefeed
means Chr(13) + Chr(10) . SO If you want appended text start by next line then Use VbCrLf constant or chr13)& char(10).

Sanjeev
0
 
LVL 75

Expert Comment

by:Anthony Perkins
ID: 6473295
sanjeevjain1973, trust me, vbCr works as advertised:
Text1.Text = Text1.Text & vbCr & "New text"
0
 
LVL 1

Expert Comment

by:harsh008_k
ID: 6473315
To append some text into textbox

1)U can use &
   a)Text1.Text=Text1.Text & "your text"
   b)with space
      Text1.Text=Text1.Text & ""  & "Your text"
2) a)Text1.Text=Text1.Text+"Your Text"
   b)Text1.Text=Text1.Text + "" + "Your Text"    
0
 
LVL 9

Expert Comment

by:Valliappan AN
ID: 6473790
Try this:

Text1.SelStart = Len(Text1.Text)
Text1.SelText = "Your Text"
0
Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

 
LVL 12

Expert Comment

by:jgv
ID: 6474287
acperkins,

Text1.Text = Text1.Text & vbCr & "New text"

Textbox with MultiLine=True will visibly print the carrige return character using the above method. To move to a new line I've always used vbCrLf. What are you doing to get the vbCr to work?
0
 
LVL 75

Expert Comment

by:Anthony Perkins
ID: 6474415
jgv,

I must have been doing drugs or imagined it! So much for arrogance.

Curiously with a VB5 IDE I get the same (except 2 visible symbols) with:

Text1.Text = Text1.Text & vbCrLf & "New Text"

Who knows,

Anthony
0
 
LVL 75

Expert Comment

by:Anthony Perkins
ID: 6474426
jgv,

Never mind the last post. You are right, I had not set the MultiLine property on. duh!

Anthony
0
 

Author Comment

by:mitra_subhasis
ID: 6481518
Your answer is acceptable.
Subhasis.
0
 

Author Comment

by:mitra_subhasis
ID: 6481521
Your answer is acceptable.
Subhasis.
0
 
LVL 75

Expert Comment

by:Anthony Perkins
ID: 6482486
Totally un-deserved. Anthony
0

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
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…

746 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

14 Experts available now in Live!

Get 1:1 Help Now