我在form1_load方法里面写了如下的代码
Bitmap bmp = new Bitmap(argus.path);
Graphics g =this.CreateGraphics();
Rectangle rect = new Rectangle(this.DesktopLocation.X-this.Size.Width/2,this.DesktopLocation.Y-this.Size.Height/2, 600, 600);
g.DrawImage(bmp, rect);
g.Dispose();
运行时却没有显示背景图片。
但是把这段代码加到button的click事件响应函数中,却能成功地更改背景图片。请问这是什么原因?