ComponentFactory / Krypton

Krypton WinForms components for .NET
BSD 3-Clause "New" or "Revised" License
1.86k stars 681 forks source link

Error while adding context menu items to RibbonAppButton #215

Open DNRao18 opened 3 years ago

DNRao18 commented 3 years ago

Error while adding context menu items to RibbonAppButton

Exception: "Cannot create an instance of ComponentFactory.Krypton.ToolKit.KryptonContextMenuItemBase because it is an abstract class"

Krypton Verson:4.6.0.0

caillou15 commented 3 years ago

another issue with the same problem

164

Ash-IPRANOps commented 3 years ago

the only work around for me is to add the following lines manually to the Designer code, this is the VB:

    Me.KryptonContextMenuItem1 = New ComponentFactory.Krypton.Toolkit.KryptonContextMenuItem()

. . Me.KryptonRibbon1.RibbonAppButton.AppButtonMenuItems.AddRange(New ComponentFactory.Krypton.Toolkit.KryptonContextMenuItemBase() {Me.KryptonContextMenuItem1}) . . Me.KryptonContextMenuItem1.Text = "Menu Item" . .

Friend WithEvents KryptonContextMenuItem1 As KryptonContextMenuItem