private void Form1_Load(object sender, System.EventArgs e)
        {
            //Set the Buddy
            axToolbarControl1.SetBuddyControl(axMapControl1);

            //Create UID's and add new items to the ToolBarControl
            UID uID = new UIDClass();

            uID.Value = "esriControls.ControlsOpenDocCommand";
            axToolbarControl1.AddItem(uID, 0, -1, false, -1, esriCommandStyles.esriCommandStyleIconOnly);
            uID.Value = "esriControls.ControlsMapZoomInTool";
            axToolbarControl1.AddItem(uID, -1, -1, true, -1, esriCommandStyles.esriCommandStyleIconAndText);
            uID.Value = "esriControls.ControlsMapZoomOutTool";
            axToolbarControl1.AddItem(uID, -1, -1, false, -1, esriCommandStyles.esriCommandStyleIconAndText);
            uID.Value = "esriControls.ControlsMapPanTool";
            axToolbarControl1.AddItem(uID, -1, -1, false, -1, esriCommandStyles.esriCommandStyleIconAndText);
            uID.Value = "esriControls.ControlsMapFullExtentCommand";
            axToolbarControl1.AddItem(uID, -1, -1, false, -1, esriCommandStyles.esriCommandStyleIconAndText);
            uID.Value = "esriControls.ControlsMapZoomToLastExtentBackCommand";
            axToolbarControl1.AddItem(uID, -1, -1, true, 20, esriCommandStyles.esriCommandStyleTextOnly);
            uID.Value = "esriControls.ControlsMapZoomToLastExtentForwardCommand";
            axToolbarControl1.AddItem(uID, -1, -1, false, -1, esriCommandStyles.esriCommandStyleTextOnly);

            //Create a new customize dialog
            m_CustomizeDialog = new CustomizeDialogClass();
            //Set the customize dialog events
            startDialogE = new ICustomizeDialogEvents_OnStartDialogEventHandler(OnStartDialog);
            ((ICustomizeDialogEvents_Event)m_CustomizeDialog).OnStartDialog += startDialogE;
            closeDialogE = new ICustomizeDialogEvents_OnCloseDialogEventHandler(OnCloseDialog);
            ((ICustomizeDialogEvents_Event)m_CustomizeDialog).OnCloseDialog += closeDialogE;
            m_CustomizeDialog.SetDoubleClickDestination(axToolbarControl1);
            chkCustomization.CheckState = CheckState.Unchecked;
        }
        private void CreateCustomizeDialog()
        {
            //Create new customize dialog
            m_CustomizeDialog = new CustomizeDialogClass();
            //Set the title
            m_CustomizeDialog.DialogTitle = "Customize ToolbarControl Items";
            //Show the 'Add from File' button
            m_CustomizeDialog.ShowAddFromFile = true;
            //Set the ToolbarControl that new items will be added to
            m_CustomizeDialog.SetDoubleClickDestination(axToolbarControl1);

            //Set the customize dialog events
            startDialogE = new ICustomizeDialogEvents_OnStartDialogEventHandler(OnStartDialog);
            ((ICustomizeDialogEvents_Event)m_CustomizeDialog).OnStartDialog += startDialogE;
            closeDialogE = new ICustomizeDialogEvents_OnCloseDialogEventHandler(OnCloseDialog);
            ((ICustomizeDialogEvents_Event)m_CustomizeDialog).OnCloseDialog += closeDialogE;
        }
예제 #3
0
        private void CreateCustomizeDialog()
        {
            // 创建一个自定义对话框
            mCustomizeDialog = new CustomizeDialogClass();
            // 设置标题
            mCustomizeDialog.DialogTitle = "自定义工具栏";
            // 显示Add from File按钮
            mCustomizeDialog.ShowAddFromFile = true;
            // 设置新工具添加到的地方
            mCustomizeDialog.SetDoubleClickDestination(axToolbarControl1);

            // 设置自定义对话框的事件
            startDialogE = new ICustomizeDialogEvents_OnStartDialogEventHandler(OnStartDialog);
            closeDialogE = new ICustomizeDialogEvents_OnCloseDialogEventHandler(OnCloseDialog);
            ((ICustomizeDialogEvents_Event)mCustomizeDialog).OnStartDialog += startDialogE;
            ((ICustomizeDialogEvents_Event)mCustomizeDialog).OnCloseDialog += closeDialogE;
        }
		private void Form1_Load(object sender, System.EventArgs e)
		{
			//Set the Buddy
			axToolbarControl1.SetBuddyControl(axMapControl1);

			//Create UID's and add new items to the ToolBarControl
			UID uID = new UIDClass();
			uID.Value = "esriControls.ControlsOpenDocCommand";
			axToolbarControl1.AddItem(uID, 0, -1, false, -1, esriCommandStyles.esriCommandStyleIconOnly);
			uID.Value = "esriControls.ControlsMapZoomInTool";
			axToolbarControl1.AddItem(uID, -1 , -1, true, -1, esriCommandStyles.esriCommandStyleIconAndText);
			uID.Value = "esriControls.ControlsMapZoomOutTool";
			axToolbarControl1.AddItem(uID, -1, -1, false, -1, esriCommandStyles.esriCommandStyleIconAndText);
			uID.Value = "esriControls.ControlsMapPanTool";
			axToolbarControl1.AddItem(uID, -1, -1, false, -1, esriCommandStyles.esriCommandStyleIconAndText);
			uID.Value = "esriControls.ControlsMapFullExtentCommand";
			axToolbarControl1.AddItem(uID, -1, -1, false, -1, esriCommandStyles.esriCommandStyleIconAndText);
			uID.Value = "esriControls.ControlsMapZoomToLastExtentBackCommand";
			axToolbarControl1.AddItem(uID, -1, -1, true, 20, esriCommandStyles.esriCommandStyleTextOnly);
			uID.Value = "esriControls.ControlsMapZoomToLastExtentForwardCommand";
			axToolbarControl1.AddItem(uID, -1, -1, false, -1, esriCommandStyles.esriCommandStyleTextOnly);
			
            //Create a new customize dialog
            m_CustomizeDialog = new CustomizeDialogClass();
            //Set the customize dialog events 
			startDialogE = new ICustomizeDialogEvents_OnStartDialogEventHandler(OnStartDialog);
			((ICustomizeDialogEvents_Event)m_CustomizeDialog).OnStartDialog += startDialogE;
			closeDialogE = new ICustomizeDialogEvents_OnCloseDialogEventHandler(OnCloseDialog);
			((ICustomizeDialogEvents_Event)m_CustomizeDialog).OnCloseDialog += closeDialogE;
            m_CustomizeDialog.SetDoubleClickDestination(axToolbarControl1);
            chkCustomization.CheckState = CheckState.Unchecked;
		}