Answers for "how to draw a rectangle in c#"

C#
0

how to draw a rectangle in c#

public void DrawRectangleInt(PaintEventArgs e)
{
             
    // Create pen.
    Pen blackPen = new Pen(Color.Black, 3);
             
    // Create location and size of rectangle.
    int x = 0;
    int y = 0;
    int width = 200;
    int height = 200;
             
    // Draw rectangle to screen.
    e.Graphics.DrawRectangle(blackPen, x, y, width, height);
}
Posted by: Guest on December-25-2020

Code answers related to "how to draw a rectangle in c#"

C# Answers by Framework

Browse Popular Code Answers by Language