How can I draw a tick (check mark) in C#? I am having trouble figuring out how to connect the points from top to bottom and then from top to right. I am using WinForms
and GDI+
1 Answer
The simplest way would be to just draw two separate lines. One pointing down, and to the right, and the second, pointing up, and to the right. The second line would "start" where the first line ends. You can figure out the calculations yourself very easily, once you have decided on the size of your checkmark.
paintEventArgs.Graphics.DrawLine(new Pen(Color.FromArgb(13, 13, 13), 1),
7, 15, 11, 18);
paintEventArgs.Graphics.DrawLine(new Pen(Color.FromArgb(13, 13, 13), 1),
11, 18, 18, 10);
-
ok but do you have documents for this? I am finding it hard too find the right source material for drawing in gdi– SoleApr 1, 2016 at 13:01
-
-
this is working jase but please can you help me find the source material?– SoleApr 1, 2016 at 13:02
-
@Sole Ok, so here's a link to some documentation: msdn.microsoft.com/en-us/library/aa984364(v=vs.71).aspx. Apr 1, 2016 at 13:10