Cursor in text with rvprDoNotAutoSwitch in his protection
Posted: Mon Jul 27, 2020 9:08 am
In a TDBRichViewEdit I have user-entered text and automatically inserted text.
The automatically inserted text is inserted with
Now I need to know, when the user hits a button, if the cursor is on user entered text (unprotected) or auto-inserted text (protected).
I tried
but due to rvprDoNotAutoSwitch the text style does not change when the user moves the cursor into the protected area.
Is there a way to check if I am in a protected or unprotected text when the text has rvprDoNotAutoSwitch in its protection?
Best regards
Bjoern
The automatically inserted text is inserted with
Code: Select all
TextStyle.Protection := [rvprModifyProtect,rvprConcateProtect,rvprDoNotAutoSwitch,rvprStyleProtect,rvprStyleSplitProtect];
TextStyle.Color := clGray;
TextStyle.BackColor := clbtnface;
I tried
Code: Select all
if (rvprModifyProtect in TDBRichViewEdit(ActiveControl).Style.TextStyles[TDBRichViewEdit(Mainform.ActiveControl).CurTextStyleNo].protection) then
Is there a way to check if I am in a protected or unprotected text when the text has rvprDoNotAutoSwitch in its protection?
Best regards
Bjoern