在一个UserControl上放置一个label 在这个label上画箭头
用以下的程序 画出来的线无法显示
private void bLbPort_Paint(object sender, PaintEventArgs e)
{
Graphics g = bLbPort.CreateGraphics();
Pen myPen = new Pen(Color.Black);
g.DrawLine(myPen, new Point(0, 0), new Point(10, 10));
g.DrawLine(myPen, new Point(0, 0), new Point(10, 10));
myPen.Dispose();
}
给这个label添加一个click事件
private void bLbPort_Click(object sender, PaintEventArgs e)
{
Graphics g = bLbPort.CreateGraphics();
Pen myPen = new Pen(Color.Black);
g.DrawLine(myPen, new Point(0, 0), new Point(10, 10));
g.DrawLine(myPen, new Point(0, 0), new Point(10, 10));
myPen.Dispose();
}
单击l