My own RadMenuItem

1 Answer 12 Views
Menu
darin
Top achievements
Rank 1
Iron
Iron
darin asked on 28 Mar 2022, 07:22 PM

This happens on both a RadMenu and a RadContextMenu.

I have a contextmenu tied to a text box. THere are 2 items on the context menu. One is defined as RadMenuItem, one is defined as cMyMenuItem.

My Code:

Public Class cMyMenuItem
    Inherits Telerik.WinControls.UI.RadMenuItem

    Sub New()

    End Sub
End Class

 

Now, when the program is run, the menu item defined as RadMenuItem is fine, but the one defined as cMyMenuItem has a heavy border around it.

What do i need to setup in my class so the border isn't there.

 

1 Answer, 1 is accepted

Sort by
0
Accepted
Dess | Tech Support Engineer, Principal
Telerik team
answered on 29 Mar 2022, 02:13 PM

Hi, Darin,

According to the provided screenshot, it seems that the custom RadMenuItem doesn't have a style applied to it. Please refer to the following help article demonstrating how to inherit the style settings as well:

https://docs.telerik.com/devtools/winforms/telerik-presentation-framework/inherit-themes-from-radcontrols-derivatives 

I hope this information helps. If you need any further assistance please don't hesitate to contact me. 

Regards,
Dess | Tech Support Engineer, Principal
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.

darin
Top achievements
Rank 1
Iron
Iron
commented on 29 Mar 2022, 02:26 PM

The radmenuitem doesn't seem to have any properties that are Theme so i don't know where the theme for the radmenuitem is set.
Dess | Tech Support Engineer, Principal
Telerik team
commented on 29 Mar 2022, 02:32 PM

Hi, Darin,

I have followed the demonstrated code snippet for overriding the ThemeEffectiveType property and it seems to work as expected on my end: 

    Sub New()

        ' This call is required by the designer.
        InitializeComponent()

        Me.RadMenuItem1.Items.Add(New RadMenuItem("menu item"))
        Dim item As New cMyMenuItem()
        item.Text = "Test"
        Me.RadMenuItem1.Items.Add(item)

    End Sub

    Public Class cMyMenuItem
        Inherits Telerik.WinControls.UI.RadMenuItem

        Sub New()

        End Sub

        Protected Overrides ReadOnly Property ThemeEffectiveType() As Type
            Get
                Return GetType(RadMenuItem)
            End Get
        End Property
    End Class

 

darin
Top achievements
Rank 1
Iron
Iron
commented on 29 Mar 2022, 02:35 PM

You are correct.

Thank you. I was looking at the different properties and didn't see it listed, so i wasn't expecting to be able to override it.

Thanks for your help on this one.

Tags
Menu
Asked by
darin
Top achievements
Rank 1
Iron
Iron
Answers by
Dess | Tech Support Engineer, Principal
Telerik team
Share this question
or