trichview.com

trichview.support




Re: How can i stop text style from continuing?


Return to index


Author

Message

Sergey Tkachenko

Posted: 11/02/2004 11:47:10


First, you can store the current text style and restore it after the

hyperlink insertion.

But if user moves the caret from this place and returns it back, the current

text style will be switched to the hyperlink style, and if the user will

type characters, they will be added to to the end of the hyperlink.


If you add rvprDoNotAutoSwitch in the Protection of the hyperlink's text

style, the current text style will never be switched to the hyperlink's text

style. But this will affect typing not only at the end of hyperlink, but

also in its middle.


So the only way is processing OnKeyDown event. Check if the caret is at the

end of the hyperlink, and if it's so, switch the current text style to

non-hypertext style.


Examples (hyperlinks are closed when typing SPACE and ENTER):

* Demos\Delphi\Assorted\Hypertext\URLs\ (demos for v1.9)

* RichViewActions




> Hello.

>

> When I edit from the end of an item, I want to stop

> the text style of that item from continuing.

>

> A good example is a hyperlink. After setting a link to a selection

> (ie. set color to blue, set underline, set tag to an URL),

> i want to add normal text to the end of the link without

> removing the style manually.

>

> How can i do this?





Powered by ABC Amber Outlook Express Converter