This document is archived and information here might be outdated. Recommended version. |
ArcObjects Help for .NET developers > ArcObjects namespaces > Controls > ESRI ArcGIS Controls > Interfaces > IT > ITOCControl2 Interface > ITOCControl2.GetSelectedItem Method (ArcObjects .NET 10.5 SDK) |
Returns the selected item in the TOCControl.
[Visual Basic .NET] Public Sub GetSelectedItem ( _ ByRef ItemType As esriTOCControlItem, _ ByRef BasicMap As IBasicMap, _ ByRef Layer As ILayer, _ ByRef Unk As Object, _ ByRef Data As Object _ )
[C#] public void GetSelectedItem ( ref esriTOCControlItem ItemType, ref IBasicMap BasicMap, ref ILayer Layer, ref object Unk, ref object Data );
[C++]
HRESULT GetSelectedItem(
esriTOCControlItem* ItemType,
IBasicMap** BasicMap,
ILayer** Layer,
LPUNKNOWN* Unk,
VARIANT* Data
);
[C++]
Parameters ItemType [in, out]
ItemType is a parameter of type esriTOCControlItem BasicMap [in, out]
BasicMap is a parameter of type IBasicMap Layer [in, out]
Layer is a parameter of type ILayer Unk [in, out] Unk is a parameter of type LPUNKNOWN Data [in, out] Data is a parameter of type VARIANT
Returns the selected item in the TOCControl. The selected item may have been selected interactively by the end user clicking on the TOCControl or programmatically using the SelectItem method.
ItemType specifies an enumeration indicating the type of item (none, map, layer, heading or legend class).
Map specifies an IMap object.
Layer specifies an ILayer object.
Unk specifies an ILegendGroup object.
Data specifies a long indicating the index of the legend class within the legend group. Use this index in conjunction with the legend group to obtain a particular legend class. An index of -1 refers to the heading if it is present.
IBasicMap map=null; ILayer layer=null; Object other=null; Object index=null; esriTOCControlItem item=esriTOCControlItem.esriTOCControlItemNone; axTOCControl1.GetSelectedItem(ref
item,ref
map,ref
layer,ref
other,ref
index);
Dim
pMapAs
IMap=Nothing Dim
pLayerAs
ILayer=Nothing Dim
pOtherAs Object
=Nothing Dim
pItemAs
esriTOCControlItemDim
pIndexAs Object
=Nothing
AxTOCControl1.GetSelectedItem(pItem, pMap, pLayer, pOther, pIndex)