Dienstag, 8. November 2011

RichTextBox loses format

A System.Windows.Forms.RichTextBox control loses the text format when its parent control chain is changed or the visibility of a parent control changes.

This happens in particular when

  • setting the RichTextBox.Rtf property before the control's handle is created
  • the RichTextBox is inside a DevExpress DockingPanel and the panel is re-docked 

A workaround for this is to create a class derived from RichTextBox and override OnFontChanged with an empty method body.

Keine Kommentare:

Kommentar veröffentlichen