I used
Pen pen = new Pen(Color.Red);
pen.DashStyle = System.Drawing.Drawing2D.DashStyle.Dot;
to shape the border of rectangle but now I only need to show the corner of that rectangle.
I used
Pen pen = new Pen(Color.Red);
pen.DashStyle = System.Drawing.Drawing2D.DashStyle.Dot;
to shape the border of rectangle but now I only need to show the corner of that rectangle.
You could use 2 lines to get the effect you want:
private void MainForm_Paint(object sender, PaintEventArgs e)
{
Pen pen = new Pen(Color.Red);
pen.DashStyle = System.Drawing.Drawing2D.DashStyle.Dot;
e.Graphics.DrawLine(pen, 0, 0, 50, 0 );
e.Graphics.DrawLine(pen, 0, 0, 0, 50);
}
This draws the corner of a rectangle in the top left corner of the form.
You can draw it by yourself by
DrawLine
function inPaint
event handler, something like this:It's a use case, maybe you need other coordinates, but you can fix it easily.