This example illustrates how to use RichEditControl in a "Log Viewer"-like application. First, we adjust the default view settings in the form's constructor and default document settings in the RichEditControl.DocumentLoaded / RichEditControl.EmptyDocumentCreated event handlers correspondingly. Note that we turn off word wrapping by using the approach provided in the How to disable word wrapping in the Simple view code example.
To append a new message to the RichEditControl, use the SubDocument.AppendText Method. Note that though it is much easier to use the following logic instead:
[C#]richEditControl1.Text+=messageText;
However, this code will cause the entire document to be reloaded. This will slow down your application and cause flickering. Thus, this approach is not the correct one.
Here is a screenshot that illustrates a sample application in action:
See Also:
SubDocument essentials - simple examples