⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 appearance.cs

📁 ui form windows csharp
💻 CS
字号:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Text;
using System.Windows.Forms;
using ESRI.ArcGIS.Controls;
using ESRI.ArcGIS.SystemUI;
namespace UI
{
    public partial class Appearance : UserControl, InterfaceList
    {
        public Appearance()
        {
            InitializeComponent();
        }        
        #region InterfaceList 成员
        public void RefreshData()
        {
           
        }
 
        #endregion

        private void chkOrientation_CheckedChanged(object sender, EventArgs e)
        {
            if (chkOrientation.Checked == true)
                axToolbarControl1.Orientation = esriToolbarOrientation.esriToolbarOrientationVertical;
            else
                axToolbarControl1.Orientation = esriToolbarOrientation.esriToolbarOrientationHorizontal;
        }

        private void chkHiddenItems_CheckedChanged(object sender, EventArgs e)
        {
            if (chkHiddenItems.Checked == true)
                axToolbarControl1.ShowHiddenItems = true;
            else
                axToolbarControl1.ShowHiddenItems = false;
        }

        private void chkFillDirection_CheckedChanged(object sender, EventArgs e)
        {
            if (chkFillDirection.Checked == true)
                axToolbarControl1.FillDirection = esriToolbarFillDirection.esriToolbarFillVertical;
            else
                axToolbarControl1.FillDirection = esriToolbarFillDirection.esriToolbarFillHorizontal;
        }

        private void Appearance_Load(object sender, EventArgs e)
        {
            axToolbarControl1.SetBuddyControl(axMapControl1);

            //Add new items to the ToolbarControl
           // axToolbarControl1.AddItem("esriControls.ControlsGlobeOpenDocCommand", 0, -1, false, 0, esriCommandStyles.esriCommandStyleIconOnly);
           // axToolbarControl1.AddToolbarDef("esriControls.ControlsGlobeGlobeToolbar", -1, true, 0, esriCommandStyles.esriCommandStyleIconOnly);
            //axToolbarControl1.AddToolbarDef("esriControls.ControlsGlobeRotateToolbar", -1, false, 0, esriCommandStyles.esriCommandStyleIconOnly);
            axToolbarControl1.RemoveAll();
            axToolbarControl1.AddItem("esriControls.ControlsMapZoomInTool", 0, -1, false, 0, esriCommandStyles.esriCommandStyleIconOnly);
            axToolbarControl1.AddItem("esriControls.ControlsMapZoomOutTool", 0, -1, false, 0, esriCommandStyles.esriCommandStyleIconOnly);
            axToolbarControl1.AddItem("esriControls.ControlsNewCircleTool", 0, -1, false, 0, esriCommandStyles.esriCommandStyleIconOnly);
            // axToolbarControl1.AddToolbarDef("esriControls.ControlsGlobeGlobeToolbar", -1, true, 0, esriCommandStyles.esriCommandStyleIconOnly);
           //axToolbarControl1.AddToolbarDef("esriControls.ControlsGlobeRotateToolbar", -1, false, 0, esriCommandStyles.esriCommandStyleIconOnly);
        }

        private void btnBackColor_Click(object sender, EventArgs e)
        {
            ColorDialog colorDialog = new ColorDialog();
            //Show the ColorDialog and exit if user cancelled
            if (colorDialog.ShowDialog() == DialogResult.Cancel) return;

            //Get color from ColorDialog
            System.Drawing.Color color = colorDialog.Color;

            //The ToolbarControl host wrapper expects a SystemDrawingColor. The 
            //ToolbarControl type library wrapper expects an OLE_Color. The OLE_Color
            //is made up as follows:(Red) + (Green * 256) + (Blue * 256 * 256)		
            //IToolbarControl2 toolbarControl = (IToolbarControl2) axToolbarControl1.Object;
            //toolbarControl.BackColor = (color.R + (color.G * 256) + (color.B * 256 * 256));
            axToolbarControl1.BackColor = color;

            colorDialog = null;
        }

        private void btnFadeColor_Click(object sender, EventArgs e)
        {
            //Create new ColorDialog control
            ColorDialog colorDialog = new ColorDialog();
            //Show the ColorDialog and exit if user cancelled
            if (colorDialog.ShowDialog() == DialogResult.Cancel) return;

            //Get color from ColorDialog
            System.Drawing.Color color = colorDialog.Color;

            //The ToolbarControl host wrapper expects a SystemDrawingColor. The 
            //ToolbarControl type library wrapper expects an OLE_Color. The OLE_Color
            //is made up as follows:(Red) + (Green * 256) + (Blue * 256 * 256)		
            //IToolbarControl2 toolbarControl = (IToolbarControl2) axToolbarControl1.Object;
            //toolbarControl.FadeColor = (color.R + (color.G * 256) + (color.B * 256 * 256));
            axToolbarControl1.FadeColor = color;

            colorDialog = null;
        }
    }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -