c#如何在窗体上画线、画图,我从网上搜的,运行结果没显示出有画线? 10
publicpartialclassForm1:Form{publicvoidvForm1(){InitializeComponent();Graphicsg;g=thi...
public partial class Form1 : Form
{
public void vForm1()
{
InitializeComponent();
Graphics g;
g = this.CreateGraphics();
Pen mypengreen = new Pen(Color.Green,5);
g.DrawLine(mypengreen,10,10,100,100);
}
}
然后我在Main方法里进行实例化,
Form1 a=new Form1();
a.vForm1();
运行结果没显示有画线效果? 展开
{
public void vForm1()
{
InitializeComponent();
Graphics g;
g = this.CreateGraphics();
Pen mypengreen = new Pen(Color.Green,5);
g.DrawLine(mypengreen,10,10,100,100);
}
}
然后我在Main方法里进行实例化,
Form1 a=new Form1();
a.vForm1();
运行结果没显示有画线效果? 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询