Remove LegendItem black border from RadMap (WinFroms)

1 Answer 42 Views
Map
Ruhal
Top achievements
Rank 1
Ruhal asked on 22 Nov 2024, 01:22 PM
I've tried to remove the black border around legenditems in RadMap to no avail. I've also tried to change the border colour to white and that has not worked.  I was able to change the element spacing using  .ElementSpacing = 0 but have not been able to remove the item borders. I've pasted the code below, how can I remove the black border around legend items? I'm using .Net Framework 4.8 Winforms.

 

Thanks

 

For Each dColor As Double In {0, 0.25, 0.5, 0.75, 1}.Reverse()
        Dim oLegendItem As New MapLegendItemElement("", Color.White)

        oLegendItem.EnableBorderHighlight = False
        oLegendItem.BorderWidth = 0 ' Remove black outline?
        oLegendItem.Margin = New Padding(0)
        oLegendItem.Padding = New Padding(0)
        oLegendItem.MinSize = New Size(20, 10)
        oLegendItem.HorizontalLineWidth = 0
        oLegendItem.BorderBottomColor = Color.White
        oLegendItem.BorderTopColor = Color.White
        oLegendItem.BorderTopWidth = 0
        oLegendItem.BorderBottomWidth = 0
        oLegendItem.DrawBorder = False

        oLegendItem.BackColor = Color.White
        oLegendItem.BackColor2 = Color.White
        oLegendItem.BackColor3 = Color.White
        oLegendItem.BackColor4 = Color.White
        oLegendItem.BorderBottomShadowColor = Color.White
        oLegendItem.BorderColor = Color.White
        oLegendItem.BorderColor2 = Color.White
        oLegendItem.BorderColor3 = Color.White
        oLegendItem.BorderColor4 = Color.White
        oLegendItem.BorderInnerColor = Color.White
        oLegendItem.BorderInnerColor2 = Color.White
        oLegendItem.BorderInnerColor3 = Color.White
        oLegendItem.BorderInnerColor4 = Color.White
        oLegendItem.ShadowColor = Color.White
        oLegendItem.BorderInnerColor4 = Color.White

        oLegendItem.BorderThickness = New Padding(10)
        oLegendItem.BorderHighlightThickness = 0
        oLegendItem.DrawFill = False

        .ItemStackElement.Children.Add(oLegendItem)
    Next


    With .ItemStackElement
        .BackColor = Color.White
        .BackColor2 = Color.White
        .BackColor3 = Color.White
        .BackColor4 = Color.White
        .BorderBottomShadowColor = Color.White
        .BorderColor = Color.White
        .BorderColor2 = Color.White
        .BorderColor3 = Color.White
        .BorderColor4 = Color.White
        .BorderInnerColor = Color.White
        .BorderInnerColor2 = Color.White
        .BorderInnerColor3 = Color.White
        .BorderInnerColor4 = Color.White
        .ShadowColor = Color.White
        .BorderInnerColor4 = Color.White


        .ElementSpacing = 0  ' Remove spacing
        .EnableElementShadow = False

        .DrawBorder = False
        .EnableFocusBorder = False
        .BorderColor = Color.White
        .BorderBottomColor = Color.White
        .BorderWidth = 0
        .EnableBorderHighlight = False
        .DrawBorder = False
        .BorderBottomWidth = 0
        .BorderBottomWidth = 0
        .BorderThickness = New Padding(0)
        .BorderHighlightThickness = 0
    End With
End With

1 Answer, 1 is accepted

Sort by
1
Accepted
Nadya | Tech Support Engineer
Telerik team
answered on 26 Nov 2024, 02:07 PM

Hello, Ruhal,

In order to remove the border around the MapLegendItemElement, you should access the ColorElement and disable the border. Please refer to the following code snippet:

    For Each item As MapLegendItemElement In Me.radMap1.MapElement.LegendElement.ItemStackElement.Children
        item.ColorElement.DrawBorder = False
    Next

As a result, the borders around legend items do not show:

I hope this helps. If you have other questions please let me know.

Regards,
Nadya | Tech Support Engineer
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Ruhal
Top achievements
Rank 1
commented on 09 Dec 2024, 02:19 PM

Perfect, thank you.
Tags
Map
Asked by
Ruhal
Top achievements
Rank 1
Answers by
Nadya | Tech Support Engineer
Telerik team
Share this question
or