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. 定时往oracle插入数据

    1创建存储过程 create or replace procedure job_proc isbegininsert into yy (yid) values (sysdate);end; 2创建jo ...

  2. 【转】SQLServerDBA十大必备工具---让生活轻松点

    曾经和一些DBA和数据库开发人员交流时,问他们都用过一些什么样的DB方面的工具,大部分人除了SSMS和Profile之外,基本就没有使用过其他工具了: 诚然,SSMS和Profile足够强大,工作的大 ...

  3. Netty之Java堆外内存扫盲贴

    Java的堆外内存本来是高贵而神秘的东西,只在一些缓存方案的收费企业版里出现.但自从用了Netty,就变成了天天打交道的事情,毕竟堆外内存能减少IO时的内存复制,不需要堆内存Buffer拷贝一份到直接 ...

  4. 学习OpenCV——Surf(特征点篇)&flann

    Surf(Speed Up Robust Feature) Surf算法的原理                                                             ...

  5. iOS 杂记

    一,demo 1,视图跳转 MaryPopin:  https://github.com/Backelite/MaryPopin 2,Nimbus是一个开源的iOS框架,比起Three20,Nimbu ...

  6. iOS中UIWebView与其中网页的javascript的交互

    首发:个人博客,更新&纠错&回复 1.本地语言调js的方式与android中的方式类似,也是向WebView控件发送要调用的js语句 2. 但js调本地语言,则不是像android那样 ...

  7. redmine设置

    接上篇. 1.redmine新版本已经比较强大了,可以定制所有字段(含标准字段和自定义字段)的读写属性.这里为了避免字段过多影响用户感受,希望增加功能将不相关的字段屏蔽,下载插件Workflow Hi ...

  8. java开发环境的主题色的变化

     eclipse:Help->Install New Software->Work with:Update Site - http://eclipse-color-theme.github ...

  9. easyui dialog 扩展load

    $.extend($.fn.panel.methods, { showMask: function(jq, msg){ return jq.each(function(){ var pal = $(t ...

  10. [问题2014A04] 复旦高等代数 I(14级)每周一题(第六教学周)

    [问题2014A04]  设 \(A,B,C,D\) 均为 \(n\) 阶方阵. (1) 若 \(A^2=A\), \(B^2=B\), \((A+B)^2=A+B\), 证明: \(AB=BA=0\ ...