C#,Graphics运行后,窗体中没有任何线和矩形块,怎么回事?
privatevoidForm7_Load(objectsender,EventArgse){using(Graphicsg=this.CreateGraphics())...
private void Form7_Load(object sender, EventArgs e)
{
using (Graphics g = this.CreateGraphics())
{
g.DrawLine(Pens.Black, 30, 10, 100, 45);
g.FillRectangle(Brushes.Blue, new Rectangle(150, 15, 140, 90));
g.DrawRectangle(Pens.Black, new Rectangle(150, 15, 140, 90));
}
} 展开
{
using (Graphics g = this.CreateGraphics())
{
g.DrawLine(Pens.Black, 30, 10, 100, 45);
g.FillRectangle(Brushes.Blue, new Rectangle(150, 15, 140, 90));
g.DrawRectangle(Pens.Black, new Rectangle(150, 15, 140, 90));
}
} 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询