运行后,Form出不来红色的矩形请问这是啥问题??
private void Form1_Load(object sender, EventArgs e)
{
Graphics ghs = this.CreateGraphics();//创建Graphics对象
Brush mybs = new SolidBrush(Color.Red);//使用SolidBrush类创建一个Brush对象
Rectangle tr = new Rectangle(10, 10, 120, 80); //绘制一个矩形
ghs.FillRectangle(mybs, tr);//填充矩形
}
private void Form1_Load(object sender, EventArgs e)
{
Graphics ghs = this.CreateGraphics();//创建Graphics对象
Brush mybs = new SolidBrush(Color.Red);//使用SolidBrush类创建一个Brush对象
Rectangle tr = new Rectangle(10, 10, 120, 80); //绘制一个矩形
ghs.FillRectangle(mybs, tr);//填充矩形
}
{
Graphics ghs = this.CreateGraphics();//创建Graphics对象
Brush mybs = new SolidBrush(Color.Red);//使用SolidBrush类创建一个Brush对象
Rectangle tr = new Rectangle(10, 10, 120, 80); //绘制一个矩形
ghs.FillRectangle(mybs, tr);//填充矩形
}