trichview.com

trichview.support




Re: Keyboard message and TObject insert


Return to index


Author

Message

Sergey Tkachenko

Posted: 10/06/2004 14:32:27


> Hello,

> I need to accomplish these 2 things :

> *) I have a graphic inserted in RichView during ONCreate and it has to

remain

> there just after the text that is typed, all the time.

>  ex: 'sample text that is still being typed'(graphic here)


You can protect picture from deletion:


rve.Clear;

rve.AddPictureEx('', Graphic, 0, rvvaBaseline);

rve.SetItemExtraIntProperty(rve.ItemCount-1, rvepDeleteProtect, 1);

rve.Format;


>

> *) During typing, if the user presses the 'Enter' key then a custom event

> should take place rather than Richview going to a new line.


Process OnKeyDown, check if Key=VK_RETURN, and assign Key:=0 to prevent the

defalut processing of Enter.

Note: not all operations can be performed just inside OnKeyDown. If the

caret is in a table cell, you cannot call methods that move caret outside of

it or delete this cell. If you need it, use PostMessage.





Powered by ABC Amber Outlook Express Converter