I'm trying to do a code to activate layers that are in a checkbox list, the code that I'm trying to use is this:
MxDoc = My.ArcMap.Document
Maps = MxDoc.Maps
If chxActivated.SelectedItem = True Then
GxLayer.Layer.Visible = True [COLOR="#FF0000"]HERE IS THE PROBLEM[/COLOR]
MxDoc.UpdateContents()
MxDoc.ActiveView.Refresh()
End If
I add the layers with this code
MxDoc = My.ArcMap.Document
Map = MxDoc.FocusMap
'new layer
GxLayer = New GxLayer
GxFile = GxLayer
'Layer file path
GxFile.Path = "C:\Layers\Aditional Information.lyr"
'Add the new layer to ArcMap
Map.AddLayer(GxLayer.Layer)
'Add the layer invisible
GxLayer.Layer.Visible = False
'Refresh the view
MxDoc.ActiveView.Refresh()
End Sub
Thank you!
