Set the DesignerSerializationVisibility to hidden for the TextEditorControlBase properties Document and TextEditorProperties. This prevents the forms designer from generating code that cannot be compiled when the text editor control is added to a form at design time.