You need to derive from Panel or PictureBox.
There are ramifications to this depending on how you choose to enable the buffering.
If you set the this.DoubleBuffer flag then you should be ok.
If you manually update the styles then you have to paint the form yourself in WM_PAINT.
If you really feel ambitious you can maintain and draw your own back buffer as a Bitmap.
using System.Windows.Forms;
public class MyDisplay : Panel
{
public MyDisplay()
{
this.DoubleBuffered = true;
// or
SetStyle(ControlStyles.AllPaintingInWmPaint, true);
SetStyle(ControlStyles.OptimizedDoubleBuffer, true);
UpdateStyles();
}
}
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…