I am trying to make this mini paint with three buttons(line, circle and rectangle). on each button click , a related shape with random color and start point will be printed. I've made this combo box so that the user chooses a shape and see its properties in propertyGrid :
private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
{
switch (comboBox1.SelectedItem.ToString())
{
case "circle":
{
propertyGrid1.SelectedObject = c;
}
break;
case "line":
{
propertyGrid1.SelectedObject = l;
}
break;
case "rectangle":
{
propertyGrid1.SelectedObject = r;
}
break;
default:
break;
}
}
c,l and r are new objects from circle , line or rectangle class. now I want to be able to override properties using propertyGrid, like changing a circles color or startpoint. some thing like :
private void propertyGrid1_Click(object sender, EventArgs e)
{
circle.changeproperties=Griditem.value;
}
so how should I write this?