AE位置查询时,在遍历图层数量加载时,报“未将对象引用设置到对象的实例。”的错,可以看一下图片
private void FrmSpatialQuery_Load(object sender, EventArgs e)
{
ILayer pLayer = null;
//添加图层到ckListBoxLayer
for (int i = 0;i<frmMap.axMapControl1.LayerCount; i++)
{
//加载图层
pLayer = frmMap.axMapControl1.get_Layer(i);
if (pLayer is FeatureLayer)
{
ckListBoxLayer.Items.Add(pLayer.Name);
cbBoxSoureLayer.Items.Add(pLayer.Name);
}
}
cboxRelationShip.Items.Add("Within");
cboxRelationShip.Items.Add("Intersect");
cboxRelationShip.Items.Add("Container");
}
{
ILayer pLayer = null;
//添加图层到ckListBoxLayer
for (int i = 0;i<frmMap.axMapControl1.LayerCount; i++)
{
//加载图层
pLayer = frmMap.axMapControl1.get_Layer(i);
if (pLayer is FeatureLayer)
{
ckListBoxLayer.Items.Add(pLayer.Name);
cbBoxSoureLayer.Items.Add(pLayer.Name);
}
}
cboxRelationShip.Items.Add("Within");
cboxRelationShip.Items.Add("Intersect");
cboxRelationShip.Items.Add("Container");
}
2 个回复
朱新颖
赞同来自:
MENTHA
赞同来自:
要回复问题请先登录或注册
发起人
相关问题
问题状态