110,534
社区成员
发帖
与我相关
我的任务
分享
protected override void OnPaint(PaintEventArgs e)
{
base.OnPaint(e);
Graphics g = e.Graphics;
for (int i = 0; i < 100; i += 5)
{
float width = i / 20.0f;
if (width > 2.0f) {
width = 2.0f;
}
g.DrawLine(new Pen(Color.Black, width), (float)i , (float)10, (float)i, (float)80);
}
for (int i = 0; i < 100; i += 5) {
float width = i / 20.0f;
if (width > 2.0f) {
width = 2.0f;
}
g.FillRectangle(new SolidBrush(Color.Black), (float)i, (float)100, width, (float)80);
}
}