1

I am using TAdvMemo. My problem is with the WordWrap property. It works very well when I type text in the text area, but when I add a string to it in code, it has no effect.

I have set WordWrap property to: wwRightMargin and RightMargin property to 80, but not see other property that can help me, so i ask some idea as solve it?

i mean for example:

AdvMemo.Lines.Add(MyString);

where MyString is a string as: 'hello word'. When it is longer than 80 chars, and wrap is enabled, it should wrap to a new line, but instead it's all on the same line.

Ken White
  • 123,280
  • 14
  • 225
  • 444
Marcello Impastato
  • 2,263
  • 5
  • 30
  • 52
  • 2
    I can't understand. What does "print a string" mean? – David Heffernan Sep 23 '11 at 08:00
  • Have you asked in the support forums of tmssoftware? You may get an answer there sooner. – Marjan Venema Sep 23 '11 at 08:22
  • Yes, but newsgroup not is much active :( – Marcello Impastato Sep 23 '11 at 08:47
  • hello, @david, i mean for example: AdvMemo.Lines.Add( MyString ) where MyString is a string as: 'hello word'. When it is more long of 80 chars , and wrap is enabled, it should to go in a new line, but print all in same line. – Marcello Impastato Sep 23 '11 at 08:48
  • @Marcello: Please edit your question to add the clarification you put in your comment to David, so that people can see it when they read the question itself. – Ken White Sep 23 '11 at 18:06
  • @ken, ok i do, just i ask you an example, i am new here and yet not much practise, can so tell me better as to do, too for future? thanks again. – Marcello Impastato Sep 23 '11 at 19:56
  • @Marcello: Log in with the same user account you used to post the question, and then go to the question. At the bottom left of your question, you'll see a link to "edit". Click that link. :) – Ken White Sep 23 '11 at 20:18
  • @Marcello: Yes, it's fine. (I already did it for you, but you'll know for next time. :) ) – Ken White Sep 23 '11 at 20:41
  • well thanks, now i have understood better :) thanks again – Marcello Impastato Sep 23 '11 at 20:43
  • @marcus, no, it add mystring to text line of advmemo. I have asked about as to do return back a string much long of was out margin right. In tms-newsgroup finally has answered me too, and told to add this instruction: AdvMemo.UpdateWrap. Tomorrow i check better. amd will know. – Marcello Impastato Sep 26 '11 at 20:16

2 Answers2

0

After you added text to adv memo you must update wrap by calling UpdateWrap() function. Here is an example for you:

AdvMemo.Lines.Add(MyString);
AdvMemo.UpdateWrap();

or

AdvMemo.Lines.Text(MyString);
AdvMemo.UpdateWrap();

Be sure that WordWrap property of Adv Memo is different than wwNone.

halit
  • 177
  • 7
0

Try using AdvMemo.InsertText instead. Lines.Add doesn't care about wrapping, it just handles some special chars in the string.

Heinrich Ulbricht
  • 10,064
  • 4
  • 54
  • 85