110,536
社区成员
发帖
与我相关
我的任务
分享
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
this.Paint+=new PaintEventHandler(Form1_Paint);
}
protected override void OnPaint(PaintEventArgs e)
{
//Graphics g = e.Graphics;
//g.DrawEllipse(new Pen(Color.Red, 50), new Rectangle(100, 200, 48, 20));
//g.DrawString("Test !",new Font("Courier New",40f,FontStyle.Italic),new HatchBrush(HatchStyle.Cross,Color.Teal),new Point(10,16));
}
private void Form1_Paint(object sender, PaintEventArgs e)
{
Graphics g = this.CreateGraphics();
//g.DrawEllipse(new Pen(Color.Red, 50), new Rectangle(100, 200, 48, 20));
g.DrawString("Test !",new Font("Courier New",40f,FontStyle.Italic),new HatchBrush(HatchStyle.Cross,Color.Teal),new Point(10,16));
}
}
private void Form1_Paint(object sender, PaintEventArgs e)
{
Base.OnPaint(e);//这样试试
Graphics g = this.CreateGraphics();
//g.DrawEllipse(new Pen(Color.Red, 50), new Rectangle(100, 200, 48, 20));
g.DrawString("Test !",new Font("Courier New",40f,FontStyle.Italic),new HatchBrush(HatchStyle.Cross,Color.Teal),new Point(10,16));
}