• AE删除图层

    AE 学习小结---toccontrol右键菜单删除图层 在ArcEngine中实现右键菜单可以用vs的ContexMenuStrip,也可以使用ae中的IToolbarMenu,在toccontrol中我使用的是前者。 先双击工具栏上的ContexMenuStrip,添加删除图层和打开属性表项, 定义全局变量player 在onmousedown事件中添加代码: System.Object unk = null; System.Object data = null; if (e.button == 2) { axTOCControl1.HitTest(e.x, e.y, ref toccItem, ref pBasicMap, ref player, ref unk, ref data); if (toccItem == esriTOCControlItem.esriTOCControlItemLayer) { contextMenuStrip1.Show(axTOCControl1, new System.Drawing.Point(e.x, e.y)); } //else if (toccItem == esriTOCControlItem.esriTOCControlItemMap) // { // contextMenuStrip1.Show(axTOCControl1, new System.Drawing.Point(e.x, e.y)); // } } 在删除图层项的单击事件中调用DeleteLayer方法DeleteLayer(player)即可!

    4
    946
    1014B
    2013-03-31
    50
  • C# 获取系统路径如“我的文档”

    c# 获取相对路径,操作环境变量. 一、获取当前文件的路径 1. System.Diagnostics.Process.GetCurrentProcess().MainModule.FileName 获取模块的完整路径,包括文件名。 2. System.Environment.CurrentDirectory 获取和设置当前目录(该进程从中启动的目录)的完全限定目录。 ...... C# 如何获取某用户的“我的文档”的目录 System.Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments)); System.Environment.GetFolderPath 方法 获取指向由指定枚举标识的系统特殊文件夹的路径。 ......

    0
    824
    7KB
    2012-09-08
    34
关注 私信
上传资源赚积分or赚钱