111,120
社区成员
发帖
与我相关
我的任务
分享
private void test_Paint(object sender, PaintEventArgs e)
{
Graphics gp = this.CreateGraphics();
//画线
Pen p = new Pen(Color.Black, 10);
gp.DrawLine(p, 0, 0, 0, 100);
//画方框
SolidBrush sb = new SolidBrush(Color.Red);
//int x = 10;
int x = 0;
gp.FillRectangle(sb, x, 0, 10, 100);
}


Graphics gp = this.CreateGraphics();
//画线
Pen p = new Pen(Color.Black, 10);
gp.DrawLine(p, 0, 0, 0, 100);
//画方框
SolidBrush sb = new SolidBrush(Color.Red);
int x = 10/2;
gp.FillRectangle(sb, x, 0, 10, 100);