添加panel的paint事件,然后在panel上面画出图片
例子:this.panelMain.Paint += new System.Windows.Forms.PaintEventHandler(this.panelMain_Paint);
private void panelMain_Paint(object sender, PaintEventArgs e)
{
Graphics g = e.Graphics;
g.DrawImage(new Bitmap(Properties.Resources.Legalize_main_bg), 0, 0);
}
例子:this.panelMain.Paint += new System.Windows.Forms.PaintEventHandler(this.panelMain_Paint);
private void panelMain_Paint(object sender, PaintEventArgs e)
{
Graphics g = e.Graphics;
g.DrawImage(new Bitmap(Properties.Resources.Legalize_main_bg), 0, 0);
}