1                MapXLib.Feature obj;
 2                MapXLib.Features selectedFtrs;
 3                MapXLib.Layer lyr;
 4
 5                lyr = axMap.Layers._Item("LayerName");
 6
 7                if (lyr.Selection.Count > 0)
 8                {
 9                    selectedFtrs = (MapXLib.Features)lyr.Selection;
10                    if (MessageBox.Show("确定要删除所选择的项吗?""确认", MessageBoxButtons.YesNo,MessageBoxIcon.Question) == DialogResult.Yes)
11                    {
12                        for (int i = 1; i <= lyr.Selection.Count; i++)
13                        {
14                            obj = selectedFtrs[i];
15                            lyr.DeleteFeature(obj); //删除图元
16                        }

17                        lyr.Pack(MapXLib.LayerPackConstant.miPackAll); //紧缩表
18                    }

19                }
posted on 2009-07-28 13:04  arong.NET  阅读(622)  评论(0编辑  收藏  举报