none
drawing on a panel

    Question

  • Hi,
    This might sound wierd but I wanted to draw a '.'(just a single dot) on a panel. Is it possible to draw a dot on a panel at location(x,y)? I've called the panel, panel1.

    Thanks for the help,
    Bruce
    Wednesday, November 23, 2005 6:33 AM

Answers

  • Override Panel Paint like so

    private void panel1_Paint(object sender, System.Windows.Forms.PaintEventArgs e)

    {

    System.Drawing.Graphics g = e.Graphics;

    g.DrawRectangle(new System.Drawing.Pen(System.Drawing.Color.Black),0,0,2,2);

    }

    Wednesday, November 23, 2005 6:51 AM