How to create a custom text editing control?
<p>I need to create a text editing control in C# and I'm not sure where to start.</p>

<p>For a bit of context: a C# program is going to edit an XML document (using this control). The XML document can be converted to HTML.</p>

<p>The XML document will contain the following:</p>

<ul>
<li>Normal text (obviously)</li>
<li>Headings (which will be formatted differently)</li>
<li>Lists</li>
<li>Images</li>
<li>Videos (they don't need to be viewed in the control, but there needs to be a box or something to indicate that they're there)</li>
</ul>

<p>I want this control to take the XML and render it and act as an WYSIWYG editor for the XML.</p>

<p>For the moment, I'm not to concerned about implementing all the above details (although they will need to be implemented eventually), I just want to know where to start with creating this control. Should I be inheriting from TextBoxBase (or TextBox) and going from there? And what methods would I need to override? Or should I inherit from Control (in which case I think I'd need to all the text box stuff - selecting text, copy and paste, the caret etc. - myself, which is something I don't really want to do, but I am prepared to do if I have to).</p>

<p>I am aware of preexisting controls like <a href="http://www.textcontrol.com/products/client%5Fside/" rel="nofollow">TX Text Control</a> that do something like what I want (although this one is far more powerful than I need), but I can't use these (this is for a university project), and besides, I really do want to know how to make this from scratch.</p>
