If you compile this code and use it in VS.NET you will see that you have a
control that shows you almost exactly what the control will look like (even if
you do not give it any text).
Without Text -
With Text -
Note that because you are dealing
with an array you can get the collection editor by clicking the "..." next to
the field -
This article went quite deep into designers and how to use a simple one like
HTML rendering to get a working effect.
You may be able to tell that this is not the end for custom control designers
(Part 1) as there is much more code that can be done (take a look at the
DataGrid's designer for example) and I will be providing this code and
information in future articles.
Code for this article.
The code for this article comes in two methods - TXT file and RAR archive. The
TXT file is a plain text file of the classes in this article and the RAR
contains a compiled assembly and TXT file of the classes.
Static Multi-Highlighter -
Dynamic Multi-Highlighter -
Assembly and source -
All RAR files need to be extracted with WinRAR 3.0 (or above) see
http://www.rarlabs.com/ to get it.