Hello
Of couse I help you to do your homework but as i said "
I Help You" not doing your homework.
If you mean in WinForm:
1. Create 2 Methods in code behind
private void DrawRectangle()
{
}
private void DrawEllipse()
{
{
Don't you know what method is?
Methods (C# Programming Guide)
2. In
Click
event of Buttons:
private void button1_Click(object sender, System.EventArgs e)
{
DrawRectangle();
}
private void button2_Click(object sender, System.EventArgs e)
{
DrawEllipse();
}
Don't you know about Click event?
Control.Click Event
3. And what code should you substitue for //some code1 and //some code2 ?
Look at here:
Drawing with Graphics in WinForms using C#
=====
Sorry about forgetting something. (Thanks to SA) You also need a
Control
to keep the drawn shapes. For example a
PictureBox
.
Of course after reading the last link you could find it out.