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;
        }
        /// <summary>
        /// 生成非模态定制对话框
        /// </summary>
        public void CreateCustomizeDialog()
        {
            //定义事件接口变量
            ICustomizeDialogEvents_Event pCustomizeDialogEvent = m_CustomizeDialog as ICustomizeDialogEvents_Event;

            //为当前事件实例化(打开对话框事件)
            startDialogE = new ICustomizeDialogEvents_OnStartDialogEventHandler(OnStartDialogHandler);
            //利用该事件接口对象实现打开对话框事件
            pCustomizeDialogEvent.OnStartDialog += startDialogE;
            pCustomizeDialogEvent.OnCloseDialog += OnCloseDialogHandler;
            m_CustomizeDialog.DialogTitle        = "定制对话框";
            m_CustomizeDialog.SetDoubleClickDestination(this.view.axToolbarControl1);
        }
Beispiel #3
0
        private void CreateCustomizeDialog()
        {
            // Set the customize dialog box events.
            ICustomizeDialogEvents_Event pCustomizeDialogEvent = m_CustomizeDialog as ICustomizeDialogEvents_Event;

            startDialogE = new ICustomizeDialogEvents_OnStartDialogEventHandler(OnStartDialogHandler);
            pCustomizeDialogEvent.OnStartDialog += startDialogE;
            closeDialogE = new ICustomizeDialogEvents_OnCloseDialogEventHandler(OnCloseDialogHandler);
            pCustomizeDialogEvent.OnCloseDialog += closeDialogE;
            // Set the title.
            m_CustomizeDialog.DialogTitle = "定制工具条";
            // Set the ToolbarControl that new items will be added to.
            m_CustomizeDialog.SetDoubleClickDestination(axToolbarControl1);
        }
Beispiel #4
0
        public static void CreateCustomizeDialog()
        {
            Form1.m_CustomizeDialog = new CustomizeDialog
            {
                DialogTitle     = "自定义ToolbarControl项目",
                ShowAddFromFile = true
            };
            Form1.m_CustomizeDialog.SetDoubleClickDestination(Form1.form1.axToolbarControl1);
            ICustomizeDialogEvents_OnStartDialogEventHandler startDialogE = new ICustomizeDialogEvents_OnStartDialogEventHandler(OnStartDialog);

            ((ICustomizeDialogEvents_Event)Form1.m_CustomizeDialog).OnStartDialog += startDialogE;
            ICustomizeDialogEvents_OnCloseDialogEventHandler closeDialogE = new ICustomizeDialogEvents_OnCloseDialogEventHandler(OnCloseDialog);

            ((ICustomizeDialogEvents_Event)Form1.m_CustomizeDialog).OnCloseDialog += closeDialogE;
        }
        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;
        }
Beispiel #6
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;
        }
Beispiel #7
0
 public static void create_customize_dialog()
 {
     try
     {
         mainForm.m_CustomizeDialog = new CustomizeDialog
         {
             DialogTitle     = "自定义ToolbarControl项目",
             ShowAddFromFile = true
         };
         mainForm.m_CustomizeDialog.SetDoubleClickDestination(mainForm.mainform.axToolbarControl1);
         ICustomizeDialogEvents_OnStartDialogEventHandler startDialogE = new ICustomizeDialogEvents_OnStartDialogEventHandler(OnStartDialog);
         ((ICustomizeDialogEvents_Event)mainForm.m_CustomizeDialog).OnStartDialog += startDialogE;
         ICustomizeDialogEvents_OnCloseDialogEventHandler closeDialogE = new ICustomizeDialogEvents_OnCloseDialogEventHandler(OnCloseDialog);
         ((ICustomizeDialogEvents_Event)mainForm.m_CustomizeDialog).OnCloseDialog += closeDialogE;
         return;
     }
     catch
     {
         MessageBox.Show("未知错误!", "信息提示", MessageBoxButtons.OK);
     }
 }
		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;
		}