private void Form1_Load(object sender, System.EventArgs e) { //Set buddy control axToolbarControl1.SetBuddyControl(axMapControl1.Object); //Add control command items to the ToolbarControl axToolbarControl1.AddItem("esriControls.ControlsOpenDocCommand", -1, -1, false, 0, esriCommandStyles.esriCommandStyleIconOnly); axToolbarControl1.AddItem("esriControls.ControlsMapZoomInTool", -1, -1, true, 0, esriCommandStyles.esriCommandStyleIconOnly); axToolbarControl1.AddItem("esriControls.ControlsMapZoomOutTool", -1, -1, false, 0, esriCommandStyles.esriCommandStyleIconOnly); axToolbarControl1.AddItem("esriControls.ControlsMapPanTool", -1, -1, false, 0, esriCommandStyles.esriCommandStyleIconOnly); //Add extension command items to the ToolbarControl axToolbarControl1.AddItem("ZoomFactorExtensionCSharp.SetZoomFactor", -1, -1, true, 0, esriCommandStyles.esriCommandStyleIconAndText); axToolbarControl1.AddItem("ZoomFactorExtensionCSharp.ZoomIn", -1, -1, true, 0, esriCommandStyles.esriCommandStyleIconAndText); axToolbarControl1.AddItem("ZoomFactorExtensionCSharp.ZoomOut", -1, -1, true, 0, esriCommandStyles.esriCommandStyleIconAndText); //Get the extension manager admin m_ExtensionManagerAdmin = (IExtensionManagerAdmin) new ExtensionManagerClass(); //Add the extension to the extension manager UID uID = new UIDClass(); uID.Value = "ZoomFactorExtensionCSharp.ZoomExtension"; object obj = new object(); m_ExtensionManagerAdmin.AddExtension(uID, ref obj); }
private void Form1_MdiChildActivate(object sender, System.EventArgs e) { ChildForm activeMdiChild = (ChildForm)this.ActiveMdiChild; if (activeMdiChild == null) { return; } //Set the ToolbarControl's buddy axToolbarControl1.SetBuddyControl(activeMdiChild.ActiveControl); }
private void Form1_Load(object sender, System.EventArgs e) { //Set buddy control axToolbarControl1.SetBuddyControl(axPageLayoutControl1); axTOCControl1.SetBuddyControl(axPageLayoutControl1); //Add items to the ToolbarControl axToolbarControl1.AddItem("esriControls.ControlsOpenDocCommand", -1, -1, false, 0, esriCommandStyles.esriCommandStyleIconOnly); axToolbarControl1.AddItem("esriControls.ControlsPageZoomInTool", -1, -1, true, 0, esriCommandStyles.esriCommandStyleIconOnly); axToolbarControl1.AddItem("esriControls.ControlsPageZoomOutTool", -1, -1, false, 0, esriCommandStyles.esriCommandStyleIconOnly); axToolbarControl1.AddItem("esriControls.ControlsPageZoomWholePageCommand", -1, -1, false, 0, esriCommandStyles.esriCommandStyleIconOnly); axToolbarControl1.AddItem("esriControls.ControlsPageFocusPreviousMapCommand", -1, -1, true, 0, esriCommandStyles.esriCommandStyleIconOnly); axToolbarControl1.AddItem("esriControls.ControlsPageFocusNextMapCommand", -1, -1, false, 0, esriCommandStyles.esriCommandStyleIconOnly); axToolbarControl1.AddItem("esriControls.ControlsMapFullExtentCommand", -1, -1, true, 0, esriCommandStyles.esriCommandStyleIconOnly); axToolbarControl1.AddItem("esriControls.ControlsMapZoomInTool", -1, -1, false, 0, esriCommandStyles.esriCommandStyleIconOnly); axToolbarControl1.AddItem("esriControls.ControlsMapZoomOutTool", -1, -1, false, 0, esriCommandStyles.esriCommandStyleIconOnly); axToolbarControl1.AddItem("esriControls.ControlsSelectTool", -1, -1, true, 0, esriCommandStyles.esriCommandStyleIconOnly); }
private void Form1_Load(object sender, System.EventArgs e) { //Set buddy control axToolbarControl1.SetBuddyControl(axPageLayoutControl1); axTOCControl1.SetBuddyControl(axPageLayoutControl1); //Add ToolbarControl items axToolbarControl1.AddItem("esriControls.ControlsOpenDocCommand"); axToolbarControl1.AddItem("esriControls.ControlsSaveAsDocCommand"); axToolbarControl1.AddItem("esriControls.ControlsPageZoomInTool"); axToolbarControl1.AddItem("esriControls.ControlsPageZoomOutTool"); axToolbarControl1.AddItem("esriControls.ControlsPageZoomWholePageCommand"); axToolbarControl1.AddItem("esriControls.ControlsMapZoomInTool"); axToolbarControl1.AddItem("esriControls.ControlsMapZoomOutTool"); axToolbarControl1.AddItem("esriControls.ControlsMapPanTool"); axToolbarControl1.AddItem("esriControls.ControlsMapFullExtentCommand"); axToolbarControl1.AddItem("esriControls.ControlsMapIdentifyTool"); //Disable controls button1.Enabled = false; comboBox1.Enabled = false; }