question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Question]: KryptonRibbon/RibbonAppButton/AppButtonMenuItems fails in designer and in code

See original GitHub issue

Describe the bug While designing a ribbon control, I am unable to design the app button menu. Specifically, the AppButtonMenuItems collection fails to add menu items because the designer is trying to add an instance of KryptonContextMenuItemBase but it is an abstract class.

To Reproduce Steps to reproduce the behavior:

  1. Open up the Forms Designer
  2. Add a KryptonRibbon
  3. Expand the RibbonAppButton node in the properties window
  4. Click On the ellipsis [..] of the AppButtonMenuItems row
  5. Click the Add button under the members’ list.

Expected behavior I expected a new KryptonContextMenuItem to be added to the collection and its properties displayed for editing on the property grid inside the dialog box.

Screenshots

Here is an image of the error message in the designer when the AppButtonMenuItems collection dialog is opened up and a new item is added.

image

Desktop (please complete the following information):

  • OS: Windows 10
  • Version 22H2
  • Visual Studio 2017/2022
  • WinForms/.NET Framework 4.8

Additional context I tried adding the menu items programmatically when the form loads with the following code

    KryptonContextMenuItem newItem = new KryptonContextMenuItem("New")
    {
        SplitSubMenu = true,
    };

    KryptonContextMenu menu = new KryptonContextMenu()
    {
        PaletteMode = PaletteMode.Global,
    };
    menu.Items.Add(newItem);

    kryptonRibbon1.RibbonAppButton.AppButtonMenuItems.Add(menu);

and I get an argument exception with the message Type to be added is not allowed in this collection. when the menu.Items.Add(newItem); command is reached.

Issue Analytics

  • State:closed
  • Created 5 months ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
ja72commented, Apr 18, 2023

I installed 70.22.11.312 from NuGet and replaced the references.

The problem is fixed now.

Thank you for your time.

John Alexiou

From: Peter @.> Sent: Tuesday, April 18, 2023 12:27 PM To: @.> Cc: John @.>; @.> Subject: Re: [Krypton-Suite/Standard-Toolkit] [Bug]: KryptonRibbon/RibbonAppButton/AppButtonMenuItems fails in designer and in code (Issue #1005)

Hi @ja72https://github.com/ja72

Unfortunately we don’t support 4.6.0.0. It looks as if the version that you’re currently using is a older version (CF) from 2017. Please check herehttps://github.com/Krypton-Suite/Krypton-Toolkit-Suite-Version-Dashboard for currently supported versions.

cc. @Smurf-IVhttps://github.com/Smurf-IV

— Reply to this email directly, view it on GitHubhttps://github.com/Krypton-Suite/Standard-Toolkit/issues/1005#issuecomment-1513466237, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AFLXN2KZU4UD2D6QBVFQU7LXB26IPANCNFSM6AAAAAAXCVY6WI. You are receiving this because you were mentioned.Message ID: @.***>

0reactions
Wagnerpcommented, Apr 18, 2023

No problem

Read more comments on GitHub >

github_iconTop Results From Across the Web

The designer could not be shown for this file because none ...
The full error is: The designer could not be shown for this file because none of the classes within it can be designed....
Read more >
The Designer could not be shown for this file because ...
I have just downloaded Visual Studio 2022 and tried to open the project. Although all of the code can be viewed, I can't...
Read more >
Design-time errors - Windows Forms .NET
Learn about some of the common errors that occur when the Windows Forms Designer fails to load.
Read more >
Fail Fast - Martin Fowler
An as- sertion is a tiny piece of code that checks a con- dition and then fails if the condition isn't met. So,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found