Programmatically Delete

General TRichView support forum. Please post your questions here
Post Reply
dave novo
Posts: 105
Joined: Wed Aug 31, 2005 2:13 am

Programmatically Delete

Post by dave novo »

Hello,

I would like to perform a Delete in a TRichViewEdit programatically. If there is a selection then DeleteSelection works perfectly. However, if there is no current selection, I would like to be able to trigger the same code that would happen in the user simply pressed delete, i.e. delete the next character to the right of the cursor. Of course, there may be tables etc to the right of the cursor.

Do you have sample code that can do this?

Thanks!
Sergey Tkachenko
Site Admin
Posts: 17557
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

SendMessage(RichViewEdit1.TopLevelEditor.Handle, WM_KEYDOWN, VK_DELETE, 0);
dave novo
Posts: 105
Joined: Wed Aug 31, 2005 2:13 am

Post by dave novo »

Hi Sergey,

Just as a minor request to move the code from the message handler to an actual method, and have the message handler call the method. I imagine it could be useful to expose this to users as one of your DeleteXXX methods. Maybe not though, since the fact that you have not done so by know would indicate not many people have asked for it :-)
Post Reply