如何在MapControl界面添加双击事件实现标绘及符号样式更改
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界面添加双击事件实现标绘及符号样式更改的更多相关文章
- asp.net中的ListBox控件添加双击事件
问题:在Aspx页里的ListBox A中添加双击事件,将选中项添加到另一个ListBox B中,双击ListBox B中的选中项,删除当前选中项 页面: <asp:ListBox ID=&qu ...
- ABAP QUERY报表添加双击事件
问题:一个query报表程序,客户想要每一条能编辑并打印. 解决:直接给query添加双击事件,调用新report. 1.创建report,用paramater定义要从query结果中传过来的数据. ...
- 如何在natTable表格上添加双击事件
在项目当中,有时候需要双击表格中的某一行触发一个事件或者一次数据请求,这时候,我们就需要在表格中绑定相关事件,思路实际上很简单,添加一个绑定事件就ok了,那么怎么添加呢?简单实现如下: 1.创建绑定双 ...
- Cocos2d-iphone 为sprite添加双击的事件响应
这篇文章介绍两种方式处理cocos2d中的双击事件响应. 在iOS中使用UITapGestureRecognizer ,很容易就可以添加双击事件处理,但是在cocos2d中无法直接向sprite添加U ...
- C# Note16: wpf window 中添加enter和双击事件
一.添加回车(enter)事件 在C#编程时,有时希望通过按回车键,控件焦点就会自动从一个控件跳转到下一个控件进行操作. 以用户登录为例,当输入完用户名和密码后, 需要点击登录按钮,而登录按钮必须获 ...
- Extjs给gridPanel添加单价双击事件和获取当前行的数据
有两个小属性,如下 this.on('rowdblclick', this.readContent, this); this.on('cellclick', this.gridCellClick, t ...
- c# 添加了按钮双击事件后,再删除掉代码会提示错误
有两种方法:.清空属性窗口中的双击事件(doubleclick )右边的内容: .单击“发生错误”提示窗口的“否”后,再双击错误列表里的错误项,此时编辑窗口跳转为xx.Designer.cs,然后注释 ...
- 支持行单击、双击事件的GridView和DataList控件(译)
支持行单击.双击事件的GridView和DataList控件(译) 让GridView 和 DataList 控件响应鼠标单击.双击事件.并且,使用 ClientScript.Regi ...
- GridView/DataGrid行单击和双击事件实现代码_.Net教程
功能: 单击选中行,双击打开详细页面 说明:单击事件(onclick)使用了 setTimeout 延迟,根据实际需要修改延迟时间 ;当双击时,通过全局变量 dbl_click 来取消单击事件的响应 ...
随机推荐
- CSS3动画产生圆圈由小变大向外扩散的效果
涉及到 CSS3 的动画(animation).2D 转换(transform: scale),具体如代码所示. github: https://github.com/wind-stone/CSS3- ...
- CSS3 中border-image详解
CSS3 border-image详解.应用及jQuery插件 一.border-image的兼容性 border-image可以说是CSS3中的一员大将,将来一定会大放光彩,其应用潜力真的是非常的惊 ...
- tomcat,Jboss,weblogic区别与比较
一.tomcat Tomcat 服务器是一个免费的开放源代码的Web 应用服务器,它是Apache 软件基金会(Apache Software Foundation)的Jakarta 项目中的一个核心 ...
- [课程设计]Scrum 2.3 多鱼点餐系统开发进度 (订单一览设计)
Scrum 2.3 多鱼点餐系统开发进度 (订单一览设计) 1.团队名称:重案组 2.团队目标:长期经营,积累客户充分准备,伺机而行 3.团队口号:矢志不渝,追求完美 4.团队选题:餐厅到店点餐系统 ...
- Uva 11542 乘积是平方数
题目链接:http://vjudge.net/contest/142484#problem/A 这个题目也是2016年CCPC网赛上面的题目,当时我是不会做的,但是大牛们都知道这是一个原题,最后给一队 ...
- 将B表的字段内容插入到A表字段中
update hy_b_hacker as h , ( SELECT ( @rowNO := @rowNo +1 ) AS rowno, ip FROM ( SELECT * FROM hy_b_se ...
- 内核编译选配(VMware篇)
出现这个错误的原因是相应的驱动程序没有编译进内核,所以在内核启动时,不认识分区. 一.磁盘驱动没编译进内核 VMware5.5.3 的磁盘有两种,一种是IDE的,一种是SCSI的:VMware 你在新 ...
- android小知识之fragment中调用startActivityForResult(Intent intent,int requestcode)所遇到的问题
大家都知道对于Activity和Fragment都可以注册OnActivityResult()方法,但是要注意几点: a.当activity和fragment都注册了OnActivityResult( ...
- [渣译文] 使用 MVC 5 的 EF6 Code First 入门 系列:为ASP.NET MVC应用程序读取相关数据
这是微软官方教程Getting Started with Entity Framework 6 Code First using MVC 5 系列的翻译,这里是第七篇:为ASP.NET MVC应用程序 ...
- [Python正则表达式] 字符串中xml标签的匹配
现在有一个需求,比如给定如下数据: 0-0-0 0:0:0 #### the 68th annual golden globe awards #### the king s speech earns ...