Code/Resource
Windows Develop
Linux-Unix program
Internet-Socket-Network
Web Server
Browser Client
Ftp Server
Ftp Client
Browser Plugins
Proxy Server
Email Server
Email Client
WEB Mail
Firewall-Security
Telnet Server
Telnet Client
ICQ-IM-Chat
Search Engine
Sniffer Package capture
Remote Control
xml-soap-webservice
P2P
WEB(ASP,PHP,...)
TCP/IP Stack
SNMP
Grid Computing
SilverLight
DNS
Cluster Service
Network Security
Communication-Mobile
Game Program
Editor
Multimedia program
Graph program
Compiler program
Compress-Decompress algrithms
Crypt_Decrypt algrithms
Mathimatics-Numerical algorithms
MultiLanguage
Disk/Storage
Java Develop
assembly language
Applications
Other systems
Database system
Embeded-SCM Develop
FlashMX/Flex
source in ebook
Delphi VCL
OS Develop
MiddleWare
MPI
MacOS develop
LabView
ELanguage
Software/Tools
E-Books
Artical/Document
Form1.cs
Package: arcMAP.rar [view]
Upload User: xianghe012
Upload Date: 2022-07-02
Package Size: 77k
Code Size: 5k
Category:
GIS program
Development Platform:
C#
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Text;
- using System.Windows.Forms;
- using ESRI.ArcGIS.esriSystem;
- using ESRI.ArcGIS.SystemUI;
- using ESRI.ArcGIS.Geometry;
- using ESRI.ArcGIS.Display;
- using ESRI.ArcGIS.Geodatabase;
- using ESRI.ArcGIS.Carto;
- using ESRI.ArcGIS.Controls;
- namespace ArcMap
- {
- public partial class FrmMain : Form
- {
- public IMapControl2 pMapControl;
- public IToolbarControl2 pToolBarControl;
- public ITOCControl2 pTocControl;
- public bool toolSelected = false;
- public FrmMain()
- {
- InitializeComponent();
- }
- private void FrmMain_Load(object sender, EventArgs e)
- {
- pMapControl = (IMapControl2)axMapControl1.Object;
- pTocControl = (ITOCControl2)axTOCControl1.Object;
- pToolBarControl = (IToolbarControl2)axToolbarControl1.Object;
- pToolBarControl.SetBuddyControl(pMapControl);
- pTocControl.SetBuddyControl(pMapControl);
- CreateToolBarItem();
- }
- private void CreateToolBarItem()
- {
- pToolBarControl.AddItem("esriControls.ControlsOpenDocCommand", -1, -1, false, 0, esriCommandStyles.esriCommandStyleIconOnly);
- pToolBarControl.AddItem("esriControls.ControlsAddDataCommand", -1, -1, false, 0, esriCommandStyles.esriCommandStyleIconOnly);
- pToolBarControl.AddItem("esriControls.ControlsMapZoomInTool", -1, -1, false, 0, esriCommandStyles.esriCommandStyleIconOnly);
- pToolBarControl.AddItem("esriControls.ControlsMapZoomOutTool", -1, -1, false, 0, esriCommandStyles.esriCommandStyleIconOnly);
- pToolBarControl.AddItem("esriControls.ControlsMapZoomInFixedCommand", -1, -1, false, 0, esriCommandStyles.esriCommandStyleIconOnly);
- pToolBarControl.AddItem("esriControls.ControlsMapZoomOutFixedCommand", -1, -1, false, 0, esriCommandStyles.esriCommandStyleIconOnly);
- pToolBarControl.AddItem("esriControls.ControlsMapPanTool", -1, -1, false, 0, esriCommandStyles.esriCommandStyleIconOnly);
- pToolBarControl.AddItem("esriControls.ControlsMapFullExtentCommand", -1, -1, false, 0, esriCommandStyles.esriCommandStyleIconOnly);
- pToolBarControl.AddItem("esriControls.ControlsMapZoomToLastExtentBackCommand", -1, -1, false, 0, esriCommandStyles.esriCommandStyleIconOnly);
- pToolBarControl.AddItem("esriControls.ControlsMapZoomToLastExtentForwardCommand", -1, -1, false, 0, esriCommandStyles.esriCommandStyleIconOnly);
- pToolBarControl.AddItem("esriControls.ControlsSelectFeaturesTool", -1, -1, false, 0, esriCommandStyles.esriCommandStyleIconOnly);
- pToolBarControl.AddItem("esriControls.ControlsClearSelectionCommand", -1, -1, false, 0, esriCommandStyles.esriCommandStyleIconOnly);
- pToolBarControl.AddItem("esriControls.ControlsSelectTool", -1, -1, false, 0, esriCommandStyles.esriCommandStyleIconOnly);
- pToolBarControl.AddItem("esriControls.ControlsMapIdentifyTool", -1, -1, false, 0, esriCommandStyles.esriCommandStyleIconOnly);
- pToolBarControl.AddItem("esriControls.ControlsMapFindCommand", -1, -1, false, 0, esriCommandStyles.esriCommandStyleIconOnly);
- pToolBarControl.AddItem("esriControls.ControlsMapMeasureTool", -1, -1, false, 0, esriCommandStyles.esriCommandStyleIconOnly);
- }
- private void FeatureViaProperty_Click(object sender, EventArgs e)
- {
- FrmQuery fQuery = new FrmQuery(pMapControl);
- fQuery.Show();
- }
- private void PropertyViaFeature_Click(object sender, EventArgs e)
- {
- toolSelected = true;
- }
- private void axMapControl1_OnMouseDown(object sender, IMapControlEvents2_OnMouseDownEvent e)
- {
- //if (e.button == 1 && toolSelected==true)
- //{
- // X1 = e.mapX;
- // Y1 = e.mapY;
- //}
- //if (e.button == 1 && toolSelected == true)
- //{
- // IEnvelope pEnvelop = pMapControl.TrackRectangle();
- // pMapControl.Map.ClearSelection();
- // frmProperty fProperty = new frmProperty(pMapControl, pEnvelop);
- // fProperty.Show();
- //}
- }
- private void axMapControl1_OnMouseUp(object sender, IMapControlEvents2_OnMouseUpEvent e)
- {
- //if (e.button == 1 && toolSelected == true)
- //{
- // X2 = e.mapX;
- // Y2 = e.mapY;
- // pEnvelop = new EnvelopeClass();
- // pEnvelop.XMin = X1;
- // pEnvelop.XMax = X2;
- // pEnvelop.YMin = Y2;
- // pEnvelop.YMax = Y1;
- //}
- }
- private void panToolStripMenuItem_Click(object sender, EventArgs e)
- {
- ICommand command = new ControlsMapPanToolClass();
- command.OnCreate(pMapControl);
- if (command.Enabled == true)
- {
- pMapControl.CurrentTool = (ITool)command;
- }
- }
- }
- }