private void axMapControl1_OnDoubleClick(object sender, ESRI.ArcGIS.Controls.IMapControlEvents2_OnDoubleClickEvent e)
{
if (this._App.CurrentTool == "ESRITool") return;//实现对界面正在激活状态下工具的选取,不同tool实现不同双击事件
if (this._App.CurrentTool == "ESRIToolMe")
{
IPoint pPoint = new PointClass();
pPoint.PutCoords(e.mapX, e.mapY);

ILayer player = this.GetGraphLayer("标绘图层");
IGraphicsContainer pGraphicsContainer = player as IGraphicsContainer;
IEnumElement pEnumElement = pGraphicsContainer.LocateElements(pPoint, 1);
if (pEnumElement != null)
{
IElement pElement = pEnumElement.Next();
if (pElement is ITextElement)
{

ITextElement ptextElement = pElement as ITextElement;

FrmSymbolShow1 pLabelEditCallout = new FrmSymbolShow1("TEXT");
pLabelEditCallout.ShowDialog();

ptextElement.Symbol = pLabelEditCallout.StyleGalleryItem.Item as ITextSymbol;

pGraphicsContainer.DeleteElement(pElement);
pGraphicsContainer.AddElement(pElement, 0);
//这两句可以用pGraphicsContainer.UpdataElement(pElement);来代替
}
else if (pElement is ILineElement)
{
ILineElement ptextElement = pElement as ILineElement;

FrmSymbolShow1 pLabelEditCallout = new FrmSymbolShow1("LINE");
pLabelEditCallout.ShowDialog();

ptextElement.Symbol = pLabelEditCallout.StyleGalleryItem.Item as ILineSymbol;

pGraphicsContainer.DeleteElement(pElement);
pGraphicsContainer.AddElement(pElement, 0);
}
else if (pElement is IFillShapeElement)
{
IFillShapeElement ptextElement = pElement as IFillShapeElement;

FrmSymbolShow1 pLabelEditCallout = new FrmSymbolShow1("SHAPE");
pLabelEditCallout.ShowDialog();

ptextElement.Symbol = pLabelEditCallout.StyleGalleryItem.Item as IFillSymbol;

pGraphicsContainer.DeleteElement(pElement);
pGraphicsContainer.AddElement(pElement, 0);
}

_App.axMapControl.ActiveView.PartialRefresh(esriViewDrawPhase.esriViewGraphics, null, null);
}
}
if (this._App.CurrentTool != null)
{
try
{
this._App.MapControl.CurrentTool.Deactivate();
}
catch { }
this._App.MapControl.CurrentTool = null;
this._tool = this._App.ToolCol[this._App.CurrentTool];
this._tool.OnDblClick(e.button, e.shift, e.x, e.y);
}
}

如何在MapControl界面添加双击事件实现标绘及符号样式更改的更多相关文章

  1. asp.net中的ListBox控件添加双击事件

    问题:在Aspx页里的ListBox A中添加双击事件,将选中项添加到另一个ListBox B中,双击ListBox B中的选中项,删除当前选中项 页面: <asp:ListBox ID=&qu ...

  2. ABAP QUERY报表添加双击事件

    问题:一个query报表程序,客户想要每一条能编辑并打印. 解决:直接给query添加双击事件,调用新report. 1.创建report,用paramater定义要从query结果中传过来的数据. ...

  3. 如何在natTable表格上添加双击事件

    在项目当中,有时候需要双击表格中的某一行触发一个事件或者一次数据请求,这时候,我们就需要在表格中绑定相关事件,思路实际上很简单,添加一个绑定事件就ok了,那么怎么添加呢?简单实现如下: 1.创建绑定双 ...

  4. Cocos2d-iphone 为sprite添加双击的事件响应

    这篇文章介绍两种方式处理cocos2d中的双击事件响应. 在iOS中使用UITapGestureRecognizer ,很容易就可以添加双击事件处理,但是在cocos2d中无法直接向sprite添加U ...

  5. C# Note16: wpf window 中添加enter和双击事件

     一.添加回车(enter)事件 在C#编程时,有时希望通过按回车键,控件焦点就会自动从一个控件跳转到下一个控件进行操作. 以用户登录为例,当输入完用户名和密码后, 需要点击登录按钮,而登录按钮必须获 ...

  6. Extjs给gridPanel添加单价双击事件和获取当前行的数据

    有两个小属性,如下 this.on('rowdblclick', this.readContent, this); this.on('cellclick', this.gridCellClick, t ...

  7. c# 添加了按钮双击事件后,再删除掉代码会提示错误

    有两种方法:.清空属性窗口中的双击事件(doubleclick )右边的内容: .单击“发生错误”提示窗口的“否”后,再双击错误列表里的错误项,此时编辑窗口跳转为xx.Designer.cs,然后注释 ...

  8. 支持行单击、双击事件的GridView和DataList控件(译)

    支持行单击.双击事件的GridView和DataList控件(译)         让GridView 和 DataList 控件响应鼠标单击.双击事件.并且,使用 ClientScript.Regi ...

  9. GridView/DataGrid行单击和双击事件实现代码_.Net教程

    功能: 单击选中行,双击打开详细页面 说明:单击事件(onclick)使用了 setTimeout 延迟,根据实际需要修改延迟时间 ;当双击时,通过全局变量 dbl_click 来取消单击事件的响应  ...

随机推荐

  1. JavaScript函数的调用模式

    我们说一个函数的调用模式是作为一个函数来调用,是要与其它三种调用模式做区分函数其他的三种调用: 方法调用模式,构造器调用模式,apply/call调用模式. 方法的调用模式: var obj={ fu ...

  2. sql server 中一次insert 多条的写法

    1.SELECT INTO FROM语句 注意此处 要求目标表Table2不存在,因为在插入时会自动创建表Table2,并将Table1中指定字段数据复制到Table2中.示例如下 2.INSERT ...

  3. sysobjects中字段的含义

    --列名 数据类型 描述 name sysname --对象名. Id int --对象标识号. xtype ) --对象类型.可以是下列对象类型中的一种: C = CHECK --约束 D = -- ...

  4. 自定义view imageviw

    新建一个类继承imageview package com.exaple.myselfview; import android.content.Context; import android.graph ...

  5. Linux之grep命令详解

    简介 grep (global search regular expression(RE) and print out the line,全面搜索正则表达式并把行打印出来)是一种强大的文本搜索工具,它 ...

  6. Abot爬虫和visjs

    1. 引言 最近接触Abot爬虫也有几天时间了,闲来无事打算从IMDB网站上爬取一些电影数据玩玩.正好美国队长3正在热映,打算爬取漫威近几年的电影并用vis这个JS库呈现下漫威宇宙的相关电影. Abo ...

  7. mysql重复索引、冗余索引、未使用索引的定义和查找

    1.冗余和重复索引 mysql允许在相同列上创建多个索引,无论是有意还是无意,mysql需要单独维护重复的索引,并且优化器在优化查询的时候也需要逐个地进行考虑,这会影响性能.重复索引是指的在相同的列上 ...

  8. bat命令

    将DIR设置为当前文件所在的绝对路径 @echo off echo 当前盘符:%~d0 echo 当前盘符和路径:%~dp0 echo 当前盘符和路径的短文件名格式:%~sdp0 echo 当前批处理 ...

  9. 【转】appStore上传苹果应用程序软件发布流程

    转载地址:http://blog.sina.com.cn/s/blog_68661bd801019uzd.html 首先确定帐号是否能发布, https://developer.apple.com/a ...

  10. [转]tomcat中的session管理

    转载地址:http://blog.csdn.net/iloveqing/article/details/1544958 当一个sesson开始时,Servlet容器会创建一个HttpSession对象 ...