Private Sub tocCtrl_OnDoubleClick(ByVal Button As Long, ByVal shift As Long, ByVal x As Long, ByVal y As Long)
Dim pMap As IMap
Dim pLayer As ILayer
Dim pOther As IUnknown
Dim pItem As esriTOCControlItem
Dim pIndex As Variant
'Determine what kind of item has been clicked on
tocCtrl.HitTest x, y, pItem, pMap, pLayer, pOther, pIndex
'Only layer items can have their labels edited
If pItem = esriTOCControlItemLegendClass Then
Dim pLC As ILegendClass
Dim pLG As ILegendGroup
If TypeOf pOther Is ILegendGroup Then
Set pLG = pOther
End If
Set pLC = pLG.Class(CLng(pIndex))
Dim pSym As ISymbol
Set pSym = pLC.Symbol
Dim pSS As ISymbolSelector
Dim bOK As Boolean
Set pSS = New SymbolSelector
pSS.AddSymbol pSym
bOK = pSS.SelectSymbol(0)
If bOK = True Then
Set pLC.Symbol = pSS.GetSymbolAt(0)
End If
tocCtrl.Update
mapCtrl.Refresh
End If
End Sub