trichview.com

trichview.support




Re: Same codes,but different effect in different control


Return to index


Author

Message

Sergey Tkachenko

Posted: 05/13/2005 22:27:25


For editor, Format adds one emty text string, if the editor was empty.

Remove the call of Format, it's not necessary here.


Do you use tables? This code will crash if called when the editor is in

table cell (you cannot call Clear there)


> Hi Sergey:

>     I have codes like this:

>

> procedure TForm1.rve4KeyUp(Sender: TObject; var Key: Word;

>   Shift: TShiftState);

> var

>   s : string;

>   StyleNo,ParaNo:Integer;

> begin

>   s := rve4.GetItemTextW(rve4.CurItemNo);

>   StyleNo := rve4.GetItemStyle(rve4.CurItemNo);

>   ParaNo := -1;

>

>   rv.Clear;

>   rv.Format;

>   rv.AddTextNlw(s,StyleNo,paraNo,ParaNo,true);

>   rv.Formattail;

> end;

>

>     When rv refers to a TRichView,text in variant "s" will append to the

> first

> line of the control.But when it refers to a TRichViewEdit,text begins from

> the

> second line.Please tell me why does it happen and how to due with it!Thank

> U!

>

>





Powered by ABC Amber Outlook Express Converter