There is nothing much special about the panel, except it should be a DoubleBufferedPanel. I know of three ways to get it on the Form: 1. make sure that class is already compiled (maybe in a separate DLL) and you can design it in with Visual Designer. This is the official approach. 2. or add a Panel with Visual Designer, close the Form, and edit the form.designer.cs file changing new Panel() into new DoubleBufferedPanel() (not recommended, one isn't supposed to edit a designer file) 3. or add a Panel with Visual Designer, and have it replaced at run-time. That is what I did, like so, in the Form's constructor.
Panel oldPlot=plot;
plot=new DoubleBufferedPanel();
plot.Bounds=oldPlot.Bounds;
Controls.Remove(oldPlot);
Controls.Add(plot);
plot.Paint+=plotter;
The disadvantage is you have to copy all Designer properties/events from the old to the new Panel. The alternative is to leave the Panel, and turn it into a double-buffered one by setting some ControlStyles (the DoubleBuffered property being protected cannot be modified). :)
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, and improve readability.