private void button2_Click(object sender, System.EventArgs e)
{
//Find the legend
IElement element = axPageLayoutControl1.FindElementByName("Legend", 1);
if(element != null)
{
//Delete the legend
IGraphicsContainer graphicsContainer = axPageLayoutControl1.GraphicsContainer;
graphicsContainer.DeleteElement(element);
//Refresh the display
axPageLayoutControl1.ActiveView.PartialRefresh(esriViewDrawPhase.esriViewGraphics, null, null);
//enable/disable buttons
cmdDraw.Enabled = true;
cmdDelete.Enabled = false;
cmdChangeArea.Enabled = false;
cmdChangeLine.Enabled = false;
}
}