This project is read-only.

Open Symbology Form, Label Form with ribbon tool bar

Jun 8, 2011 at 1:55 PM

Hi,

I am looking for a way to open forms of the layer popup menue from the ribbon toolbar.

The attribute table works fine with Layer.ShowAttributes() command at the ribbon toolbar.

Is there any way to open the Labeler Setup form for a selected layer?

I added Map1.FunctionMode = FunctionMode.Label to the ribbon toolbutton but it only changes the the cursor without any functionality.

In the same way I want to open the Layer Properties form from the ribbon toolbar after select a layer at the Legend.

Thank you

 

Thomas

Jun 7, 2012 at 11:18 AM

Now I found a way to open the LayerDialog to show the properties from a button on my toolbar.

If Map1.Layers.Count > 0 Then
                For i = 0 To Map1.Layers.Count - 1
                    If Map1.Layers(i).IsSelected = True Then
                        If FeatureLayerType(Map1, i) = "PolyGon" Then
                            _featureLayer = CType(Map1.Layers(i), MapPolygonLayer)
                            Dim dlg As LayerDialog = New LayerDialog(_featureLayer, New FeatureCategoryControl)
                            dlg.ShowDialog()
                        End If
                        If FeatureLayerType(Map1, i) = "PolyLine" Then
                            _featureLayer = CType(Map1.Layers(i), MapLineLayer)
                            Dim dlg As LayerDialog = New LayerDialog(_featureLayer, New FeatureCategoryControl)
                            dlg.ShowDialog()
                        End If
                        If FeatureLayerType(Map1, i) = "Point" Then
                            _featureLayer = CType(Map1.Layers(i), MapPointLayer)
                            Dim dlg As LayerDialog = New LayerDialog(_featureLayer, New FeatureCategoryControl)
                            dlg.ShowDialog()
                        End If

                    End If
                Next
            End If

 

I am trying to do the same to open the LabelSetup but without sucess. The error message says I need to create a new instance of the object, but I think this is waht I am doing.

Dim labelSet As New LabelSetup


            labelSet = New LabelSetup()
            labelSet.Layer = CType(Map1.Layers(0), MapPolygonLayer).LabelLayer
            labelSet.Show()

 

I have looked to the FeatureLayerEventReciver.cs but how I can do the same in vb.net?

private static void FeatureLayerLabelSetupClicked(object sender, LabelLayerEventArgs e)
        {
            lableSetupDialog = new LabelSetup { Layer = e.LabelLayer };
            lableSetupDialog.Show();
        }