标签:ddl control new line 无法 seh engine events 描述
通过以下方式可以很便捷的往选择集内添加要素,但是却无法触发AxMapControl下的OnSelectionChanged事件。
public static void SelectFeatures(IFeatureLayer featureLayer, int[] OIDs)
{
if (pFeatureLayer == null || OIDs == null)
{
return;
}
IFeatureSelection featureSelection = featureLayer as IFeatureSelection;
if (featureSelection != null)
{
IGeoDatabaseBridge2 geoDatabaseBridge2 = new GeoDatabaseHelperClass();
geoDatabaseBridge2.AddList(featureSelection.SelectionSet, ref OIDs);
}
}
可以通过ISelectEvents接口来解决这个问题,该接口可由IMap接口QI。
ISelectionEvents selectEvents = map as ISelectionEvents;
if (selectEvents != null)
{
selectEvents.SelectionChanged();
}
标签:ddl control new line 无法 seh engine events 描述
原文地址:https://www.cnblogs.com/lLazy/p/10662186.html