private void cmdZoomPage_Click(object sender, System.EventArgs e) { //Zoom to the whole page axPageLayoutControl1.ZoomToWholePage(); //Get the IElement interface by finding an element by its name IElement element = m_PageLayoutControl.FindElementByName("ZoomExtent", 1); if (element != null) { //Delete the element m_PageLayoutControl.GraphicsContainer.DeleteElement(element); //Refresh the graphics m_PageLayoutControl.Refresh(esriViewDrawPhase.esriViewGraphics,Type.Missing, Type.Missing); } }
private void cboMaps_SelectedIndexChanged(object sender, System.EventArgs e) { IPageLayoutControl pageLayoutControl = (IPageLayoutControl)axPageLayoutControl1.GetOcx(); //Get IMapFrame interface IMapFrame element = (IMapFrame)pageLayoutControl.FindElementByName(cboMaps.Text, 1); //Set the FocusMap axPageLayoutControl1.ActiveView.FocusMap = element.Map; }