Well, the easiest way would be to create a new class, derive it from Panel, override OnPaint and place similar code that you used in the form there. Another option is, in your form, to handle the Paint Event of the Panel and place your painting code there. |