private void menuNewDoc_Click(object sender, EventArgs e) { //execute New Document command ICommand command = new CreateNewDocument(); command.OnCreate(m_mapControl.Object); command.OnClick(); }
//新建图层 private void toolStripMenuItem3_Click(object sender, EventArgs e) { ICommand command = new CreateNewDocument(); command.OnCreate(mapControl.Object); command.OnClick(); }
private void menuNewDoc_Click(object sender, EventArgs e) { //execute New Document command ICommand command = new CreateNewDocument(); command.OnCreate(m_mapControl.Object); command.OnClick(); axMapControl2.ClearLayers(); IGraphicsContainer pGraphicsContainer = axMapControl2.Map as IGraphicsContainer; //在绘制前,清除axMapControl2中的任何图形元素 pGraphicsContainer.DeleteAllElements(); }