arcengine中图例该怎样做可以实现分组?

在arcengine中的pagelayoutcontrol即布局视图中,已经添加好了图例,添加方式代码如下
 #region 添加图例
case 2:
pLegend2 = new LegendClass_2();
pElement = axPageLayoutControl1.FindElementByName("legend");
if (pElement != null)
{
pGraphicsContainer.DeleteElement(pElement);
}

pElementTypeName = "lenend";
pUid = new UIDClass();
pUid.Value = "esriCato.Legend";
if (pGraphicsContainer == null) return;
pMapSurround = pLegend2 as IMapSurround;
pMapSurround.Map = pActiveView.FocusMap;
pMapFrame = pGraphicsContainer.FindFrame(pActiveView.FocusMap) as IMapFrame;
if (pMapFrame == null) return;

pMapSurroundFrame = new MapSurroundFrameClass();
pMapSurroundFrame = pMapFrame.CreateSurroundFrame(pUid, null);
pMapSurroundFrame.MapSurround = pMapSurround;
pMapSurroundFrame.MapSurround.Name = pElementTypeName;
pMapSurroundFrame.MapFrame = pMapFrame;

pElement = pMapSurroundFrame as IElement;
try
{
pElement.Geometry = axPageLayoutControl1.TrackRectangle();
}
catch
{
MessageBox.Show("请拉框选择范围!", "提示");
return;
}
pElement.Activate(pActiveView.ScreenDisplay);
pElement.Draw(pActiveView.ScreenDisplay, null);

pGraphicsContainer.AddElement(pElement, 0);
pActiveView.PartialRefresh(esriViewDrawPhase.esriViewGeography, null, null);

//图例标题字体样式
pLegend2.Title = "图例";
pTitltFont.Name = "黑体";
pTitltFont.Bold = true;
pTitltFont.Size = 16;
pTitltTextSymbol.Color = ColorToIColor(Color.Black);
pTitltTextSymbol.Font = pTitltFont;
pLenendFormat.TitleSymbol = pTitltTextSymbol;

//图例图层名字体样式
pLayerFont.Name = "仿宋_GB2312";
pLayerFont.Size = 13;
pLayerTextSymbol.Font = pLayerFont;

//图例标签字体样式
pLabelFont.Name = "仿宋_GB2312";
pLabelFont.Size = 13;
pLabelTextSymbol.Font = pLayerFont;

for (int i = 0; i < pLenendItemsString.Count; i++)
{
for (int j = 0; j < pLegend2.ItemCount; j++)
{
if (pLenendItemsString[i].ToString() == pLegend2.get_Item(j).Layer.Name)
pLegend2.RemoveItem(j);
}
}
pLegend2.AdjustColumns(pColumnCount);
pLegend2.Refresh();
tag = 0;
break;
#endregion
接下来如何实现取消分组的操作,记得在arcmap里我是将图例转换为图形如何才可以取消分组,现在上面的代码好像产生的就是图形式的图例,那么该如何实现取消分组那。

[}Z7NW6RO}AHA@G_0PN1TTS.png

 
已邀请:

要回复问题请先登录注册