User-1084487072 posted
had a Graph library I was creating in C#. I want to be able to draw lines in the panel. Here is what I was using to create the x and y axis for my library. public class Axis { private PointF _pnt1; private Control _control; public Axis(Control control, PointF
pnt1, PointF pnt2) { _control = control; _pnt1 = pnt1; _control.Paint += new PaintEventHandler(this.control_Paint); } private void control_Paint(object sender, PaintEventArgs e) { // Create a graphics object for the _panel. Graphics _g = e.Graphics; Pen pen
= new Pen(Color.Black); _g.DrawRectangle(pen, _pnt1,40,40); } } Basicly I was just passing a control(Panel) and drawing a rectangle at give point or any line or polygon. I was wondering if I can create a paint handler for the panel like I did with my classes
I created or something simular.