about Insert Control

General TRichView support forum. Please post your questions here
Post Reply
iambeijing086
Posts: 22
Joined: Mon Dec 02, 2013 1:41 am

about Insert Control

Post by iambeijing086 »

I Insert some TSRVCheckBox on SRichViewEdit page

and my question is:

How to disable delete these controls?
that means forbid delete these control by press backspace key or delete key.
thanks.
Sergey Tkachenko
Site Admin
Posts: 17555
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

You can set rvepDeleteProtect property:
This code inserts delete-protected checkbox:

Code: Select all

  with SRichViewEdit1.ActiveEditor.TopLevelEditor do begin
    BeginUndoGroup(rvutInsert);
    SetUndoGroupMode(True);
    if InsertControl('', CheckBox, rvvaAbsMiddle) then
      SetCurrentItemExtraIntProperty(rvepDeleteProtect, 1, True);
    SetUndoGroupMode(False);
  end;
(but it quite strange to insert as an editing operation a control that cannot be deleted as an editing operation.
iambeijing086
Posts: 22
Joined: Mon Dec 02, 2013 1:41 am

Post by iambeijing086 »

thanks very much. it's ok
Post Reply