pbProtect - DfBaseRichEdit
Toggles selected text between protected and normal text
Type: Property
Access: Read/Write
Data Type: Boolean
Parameters: None
Syntax
Property Boolean pbProtect
| Access Type | Syntax |
|---|---|
| Read Access: | Get pbProtect to BooleanVariable |
| Write Access: | Set pbProtect to BooleanVariable/Value |
Description
Toggles the selected text of the control between protected and normal text.
The protected character effect is unique in that it does not change the appearance of text, but it does protect the text from being changed by the user.
This property has no effect if control is not paged.
Sample
This sample changes the font of the selected text to protected.
set pbProtect to True
Sample
This sample changes the font of the selected text to normal (non-protected).
set pbProtect to False
If you get this property and it is not consistent throughout the selection, it will return the pbProtect value for the first character of the selection, and LastErrorCode will equal ERR_RE_ATTR_INCONSISTENT_THROUGH_SELECTION.
Sample
This sample gets the value of pbProtect, then checks if pbProtect was not consistent throughout the selected text by checking if LastErrorCode is equal to ERR_RE_ATTR_INCONSISTENT_THROUGH_SELECTION. If so, you can do any special handling you wish in the begin...end code block.
Integer iLastErrorCode
Boolean bIsProtected
get pbProtect to bIsProtected
get LastErrorCode to iLastErrorCode
if (iLastErrorCode = ERR_RE_ATTR_INCONSISTENT_THROUGH_SELECTION) begin
// do something
end