Quantcast
Channel: Forums - ArcObjects SDKs
Viewing all articles
Browse latest Browse all 1374

Activate Layers with checkBoxList

$
0
0
Hello again,
I'm trying to do a code to activate a Layers that are in a checkboxlist, the code that I'm trying to use is this:
Code:

Private Sub chxActivated_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles chxActivated.SelectedIndexChanged
       
        MxDoc = My.ArcMap.Document
        Maps = MxDoc.Maps


        If chxActivated.SelectedItem = True Then
            GxLayer.Layer.Visible = True HERE IS THE PROBLEM
            MxDoc.UpdateContents()
            MxDoc.ActiveView.Refresh()
        End If

I add the layers with this code
Code:

Private Sub cmdInformation_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdInformation.Click
        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!

Viewing all articles
Browse latest Browse all 1374

Trending Articles