Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using TMemo

Status
Not open for further replies.

dlare9

Programmer
Apr 3, 2007
12
JP
How do I put value in the Memo lines ,programatically?

I know I can use the Object Inspector to initialize the Memo.

I creating a program that would let you put value in the Memo in a pecific line no. Currently I stuck on this.

Any help would be much appreciated

Thanks,
dlare9

 
Off the top of my head so double check...
Code:
TMemo1->Lines->Add("This line was added");


James P. Cottingham
-----------------------------------------
[sup]I'm number 1,229!
I'm number 1,229![/sup]
 
like this:
Form4->Memo1->Lines->Add("ghfffgjhg22");
See help on TStrings, Lines in Memo are actually TStrings
 
Thanks for the help!

Just one final question though.

How do you modify the content of a particular line in TMemo?
 
Hi

if a memo has 4 lines. Then the third line would be :

Memo1->Lines->Strings[2]

Make sure that you do not reference beyond the lines, check by using the guard :

if ( Memo1->Lines->Count > 3 )
Memo1->Lines->Strings[2] = "A modified version of line 3";





Hope this helps!

Regards

BuilderSpec
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top