Problem with TAdvMemo component (about wordwrap)
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 ca开发者_运维知识库n 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.
Try using AdvMemo.InsertText
instead. Lines.Add
doesn't care about wrapping, it just handles some special chars in the string.
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.
精彩评论