Hi, I have a few parts of my text that are protected using this:
Code
// Protege texto entre {$***}
with WPRichText do begin
Finder.Clear;
Finder.ToStart;
while Finder.Next('{$*}') do
Finder.FoundAttr.IncludeStyle(afsProtected);
ReformatAll(True,True);
Modified := True;
end;
Alles anzeigen
So all the text between {$ and } are protected.. I already use ProtectedTextAttr to change the background of this text, but the users still are confused when they try to change this text and "nothing happens" (the cursor just move forward as you type)..
When my WPRichText is ReadOnly I use the OnKeyDown event and fire a message on the screen that says "Document is blocked for edition"..
How could I do the same thing with protected parts of the text? I mean, when the user try to change something that is protected, I'd like to ShowMessage something instead of just let him type and nothing happens besides the cursor move forward.
Where and how can I check that?
Thanks!