So I'm trying to create a new form, draw a rectangle and then have that rectangle shown on the form. I can't seem to get it to show. The form shows but the rectangle isnt drawn.
I have this so far:
private void btnLayout_Click(object sender, EventArgs e)
{
Form form = new Form();
form.Text = "Design";
using (Graphics g = form.CreateGraphics())
{
Pen pen = new Pen(Color.Black, 2);
Brush brush = new SolidBrush(Color.AliceBlue);
g.DrawRectangle(pen, 100, 100, 100, 200);
pen.Dispose();
}
form.Show();
}