📄 form1.cs
字号:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace GeoSelected
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
eMap1.Open(@"\program files\GeoSelected\map\Test.map");
eMap1.ViewEntire();
eMap1.ReDraw();
eMap1.Invalidate();
}
private void menuItem2_Click(object sender, EventArgs e)
{
eMap1.SetTool(Hotgis.eHotGIS.eMap.ToolType.ZoomIn);
}
private void menuItem3_Click(object sender, EventArgs e)
{
eMap1.SetTool(Hotgis.eHotGIS.eMap.ToolType.ZoomOut);
}
private void menuItem4_Click(object sender, EventArgs e)
{
eMap1.SetTool(Hotgis.eHotGIS.eMap.ToolType.Pan);
}
private void eMap1_OnGeometrySelected(int count)
{
if (count > 0)
{
panel1.Visible = true;
tabControl1.TabPages.Clear();
Hotgis.eHotGIS.eSelection selection = eMap1.GetSelection();
int tab = selection.Count;
for (int i = 0; i < tab; i++)
{
Hotgis.eHotGIS.eResultSet rs = selection.GetAt(i);
int cnt = rs.Count;
TabPage tp = new TabPage();
tp.Text = selection.GetAt(i).Layer.Name;
ListView listView = new ListView();
listView.View = View.Details;
listView.Dock = DockStyle.Fill;
for (int j = 0; j < rs.Layer.FieldCount; j++)
{
Hotgis.eHotGIS.eField fd = rs.Layer.GetFieldAt(j);
listView.Columns.Add(fd.Name, 100, HorizontalAlignment.Left);
}
string[] s = new string[rs.Layer.FieldCount];
while (rs.IsHasNext)
{
for (int k = 0; k < rs.Layer.FieldCount; k++)
{
s[k] = rs.GetString(k);
}
ListViewItem item = new ListViewItem(s);
listView.Items.Add(item);
}
tp.Controls.Add(listView);
tabControl1.TabPages.Add(tp);
}
}
else
{
panel1.Visible = false;
}
}
private void menuItem5_Click(object sender, EventArgs e)
{
eMap1.SetTool(Hotgis.eHotGIS.eMap.ToolType.PointSel);
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -