ArcEngine C# GIS开发入门作业 (四)Ex05——空间数据库查询选中要素高亮,并计算
题目:
实现效果
注意事项先不重复了,前面几篇文章都有,直接上代码,这几天在实习要顺便写个实习的文章,这个作业就先还来不及行行注释了,为了保持作业的连续性,先把作业发完,后面再注释:
form1.cs
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.Carto;
using ESRI.ArcGIS.Controls;
using ESRI.ArcGIS.ADF;
using ESRI.ArcGIS.SystemUI;
using ESRI.ArcGIS;
using ESRI.ArcGIS.Display;
using ESRI.ArcGIS.esriSystem;
using ESRI.ArcGIS.Geodatabase;
using ESRI.ArcGIS.Geometry;
namespace Ex05
{
public partial class Form1 : Form
{
#region class private members
private IMapControl3 m_mapControl = null;
private string m_mapDocumentName = string.Empty;
#endregion
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
//get the MapControl
m_mapControl = (IMapControl3)axMapControl1.Object;
//disable the Save menu (since there is no document yet)
}
private void axMapControl1_OnMouseDown(object sender, ESRI.ArcGIS.Controls.IMapControlEvents2_OnMouseDownEvent e)
{
IPoint pPoint = new PointClass();
ITopologicalOperator pTopologicalOperator = pPoint as ITopologicalOperator;
pPoint.PutCoords(e.mapX, e.mapY);
IGeometry