Prevent characters from being entered or deleted
Prevent characters from being entered or deleted
Hello! There is a RichViewEdit In which I need to prevent any new content from being entered and deleted, but need to keep the ability to change the font, style, alignment, colors, list styles. Is it possible to do it in RichViewEdit in the least labour-intensive way?
-
- Site Admin
- Posts: 17534
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
Re: Prevent characters from being entered or deleted
Do you want to apply changes to part of documents (to selected text)?
Or do you want to change styles in the whole document?
Or do you want to change styles in the whole document?
Re: Prevent characters from being entered or deleted
It is necessary to change the selected part of the document. This requires that you can not cut the text, too.
-
- Site Admin
- Posts: 17534
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
Re: Prevent characters from being entered or deleted
The simplest solution is disabling editing in TRichViewEdit by assigning RichViewEdit.ReadOnly = True.
Before any allowed operation, assign RichViewEdit.ReadOnly = False, perform this operation, then assign RichViewEdit.ReadOnly = True again.
An alternative solution, with using protection options, seems to be more complicated.
Before any allowed operation, assign RichViewEdit.ReadOnly = False, perform this operation, then assign RichViewEdit.ReadOnly = True again.
An alternative solution, with using protection options, seems to be more complicated.