Copy/Paste controls

General TRichView support forum. Please post your questions here
Post Reply
Verasoft
Posts: 1
Joined: Wed Nov 01, 2006 6:12 am
Location: USA
Contact:

Copy/Paste controls

Post by Verasoft »

I'm using a TRichViewEdit to create an electronic forms editor.
I'm creating controls responding on OnRVFControlNeeded event.
When I'm inserting controls in code, all works as expected.
But when copying and pasting an control, the Name parameter of OnRVFControlNeeded is set to the name of control being copied. So after a copy/paste operation I'm getting two controls with identical RichView names.
The only one workaround I found is to patch the richview sources and allow modifying of the "Name" parameter in event procedure. Is there any way to do this without patching the sources? Any example?

TIA
Sergey Tkachenko
Site Admin
Posts: 17559
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

You can use OnControlAction event (action = rvcaAfterRVFLoad).
Use TCustomRVData(Sender.Style.RVData).GetItemText(ItemNo) to get the control text, and SetItemText to change it.
Post Reply