我无法在面板工具上绘制带有图形路径的线条。面板线在哪里不可见。
以下是MainForm中的代码:
private void MainForm_Paint(object sender, System.Windows.Forms.PaintEventArgs e)
{
Graphics g = this.CreateGraphics();
this.Controls.Add(panel1);
g.Clear(System.Drawing.Color.Gray);
GraphicsPath gp = new GraphicsPath();
gp.AddLine(330, 676, 330 + (c / 6), 676);
gp.AddLine(330 + (c / 6), 676, 330 + (c / 6), 676 - (d / 3));
gp.CloseFigure();
g.FillPath(Brushes.Orange, gp);
g.DrawPath(Pens.Black, gp);
gp.Dispose();
}
和MainForm.Designer
// panel1
this.panel1.BackColor = System.Drawing.Color.Gray;
this.panel1.Paint += new System.Windows.Forms.PaintEventHandler(this.MainForm_Paint);
有什么建议可以做些什么来展示面板上的绘制数字?