You can decorate any control by adding some graphical rendering to it. This is done by handling the event
System.Windows.Forms.Control.Paint
or overriding the virtual method
System.Windows.Forms.Control.OnPaint
in a derived class.
Don't repeat a common mistake: don't create an instance of
System.Drawing.Graphics
! — take an instance from event arguments.
Please see
http://msdn.microsoft.com/en-us/library/system.windows.forms.control.aspx[
^].
One finer hint: as you need a border, it will be very helpful to adjust the
DisplayRectangle
. You can override this virtual property in derived class to prevent overlapping of the children with your border which will take up some room near the edges.
Please see
http://msdn.microsoft.com/en-us/library/system.windows.forms.control.displayrectangle.aspx[
^]. [EDIT: this link fixed — SA]
For more advanced information on rendering, please see my past answers:
What kind of playful method is Paint? (DataGridViewImageCell.Paint(...))[
^],
Drawing Lines between mdi child forms[
^],
capture the drawing on a panel[
^].
—SA