RichEditControl.AutoCorrect Event
Fires when text is typed in the control.
Namespace: DevExpress.Xpf.RichEdit
Assembly: DevExpress.Xpf.RichEdit.v14.2.dll
#Declaration
#Event Data
The AutoCorrect event's handler receives an argument of the AutoCorrectEventArgs type. The following properties provide information specific to this event:
Property | Description |
---|---|
Auto |
Gets or sets an object that provides methods to analyze the input text and contains a replacement object. |
#Remarks
Handle the AutoCorrect event to implement complex replacements as you type.
The RichEditControl.AutoCorrect event is handled to replace the typed $ symbol with a picture of a dollar, and substitute the text enclosed in percent symbols with custom content.
To accomplish this task, a document text obtained via the AutoCorrectEventArgs.AutoCorrectInfo property is amended by expanding its left boundary using the AutoCorrectInfo.DecrementStartPosition method, until a special symbol or a word separator symbol is found. If a resulting string meets certain conditions, such as whether it is a dollar sign or a %date% string, a replacement object is passed to the document via the AutoCorrectInfo.ReplaceWith property. A replacement object can be a string or an image.