trichview.com

trichview.support




Re: Free selection and scrolling to particular character.


Return to index


Author

Message

Sergey Tkachenko

Posted: 10/04/2004 18:03:49


> 1. I'm working with simple text in TRichViewEdit. I want to select

particular

> text from i-th character to j-th character using TRichViewEdit methods. It

> is like setting SelStart and SelLenght in TMemo or TRichEdit. And then I

> want to apply new style to this text. How can I do this? I havn't found

any

> description/example.


The native method for text selection is SetSelectionBounds.

You can also use functions from RVLinear.pas (and work with SelStart and

SelLength)


>

> 2. Please, give some suggestion about how to scroll TRichViewEdit so the

> current caret position will appear in TRichViewEdit control' window (like

> EM_SCROLLCARET message effect in TMemo).


The simplest way is reselecting. For example, you can use functions from

RVLinear unit:


var rec: TRVSelection;

begin

  RVGetSelectionEx(RichViewEdit1, rec);

  RVSetSelectionEx(RichViewEdit1, rec);

end;





Powered by ABC Amber Outlook Express Converter