mapxtreme学习笔记

时间:2020-09-26 14:45:56
【文件属性】:

文件名称:mapxtreme学习笔记

文件大小:40KB

文件格式:DOCX

更新时间:2020-09-26 14:45:56

mapxtreme

12.返回选择物信息(已完成) public Form1() { InitializeComponent(); mapControl1.Tools.FeatureSelected += new MapInfo.Tools.FeatureSelectedEventHandler(Tools_FeatureSelected); } //弹出信息 private void Tools_FeatureSelected(object sender, MapInfo.Tools.FeatureSelectedEventArgs e) { if (e.ToolName == "Select") { MapInfo.Data.IResultSetFeatureCollection irfc = MapInfo.Engine.Session.Current.Selections.DefaultSelection[0]; MapInfo.Data.Feature f = irfc[0]; MessageBox.Show(f["E_Name"].ToString()) } } //在listbox中显示所选物 private void button1_Click(object sender, EventArgs e) { MapInfo.Data.Table World = MapInfo.Engine.Session.Current.Catalog.GetTable("GZ-landmark-LL-Shift"); MapInfo.Data.IResultSetFeatureCollection fc = MapInfo.Engine.Session.Current.Selections.DefaultSelection[World]; lstFeatures.Items.Clear(); foreach (MapInfo.Data.Feature ftr in fc) { lstFeatures.Items.Add(ftr["E_Name"].ToString()); } }


网友评论