make a layer actived

Discussion created by katy2000 on Mar 18, 2011
Latest reply on Mar 21, 2011 by katy2000
hi everybody , I  have my list box with all the layers of the dataframe actived , now when I make click in one of them  I need make it "active layer" but I can find the way to make it
thank you  for your help

this is the code of my listbox

Dim pMxDoc As IMxDocument
Set pMxDoc = ThisDocument

Dim pMap As IMap
  Set pMap = pMxDoc.FocusMap
  If pMap.LayerCount > 0 Then
  Dim pAlllayers As IEnumLayer
  Dim pLayer As ILayer
  Set pAlllayers = pMap.Layers
  Set pLayer = pAlllayers.Next
  Do Until pLayer Is Nothing
frmImages.lboLayers.AddItem pLayer.Name
  Set pLayer = pAlllayers.Next
  End If

End Sub