This will add a rectangle to the form at run time at the specify location which you give as numbers:-
private void button_Click(object sender, EventArgs e)
{
Rectangle myrect = new Rectangle(200, 300, 100, 100);
Graphics g = this.CreateGraphics();
g.DrawRectangle(SystemPens.ControlDark, myrect);
g.Dispose();
}

Mahesh ChandPosted Apr 15, 2009, 4:50 PM
You may want to format your code. See how I changed the code in your blog. One way to have colored code, copy your code from Visual Studio to a doc file and then copy it here in the editor. OR use the Border Dash option in this editor.
Nikhil KumarPosted Apr 15, 2009, 1:28 PM
Try it