Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RibbonButton DropDownShowing not raised #52

Open
leglubert opened this issue Oct 9, 2019 · 3 comments
Open

RibbonButton DropDownShowing not raised #52

leglubert opened this issue Oct 9, 2019 · 3 comments

Comments

@leglubert
Copy link

if I want to fill out the "DropDownItems" collection at run time

ok no problem ... but

the DropDownShowing is not raised, if it does not contain at least one element added a time design

Amitiés
Lionel

@adriancs2
Copy link
Contributor

adriancs2 commented Oct 10, 2019

Create the DropDownShowing event:

public Form1()
{
    InitializeComponent();
    ribbonButton1.DropDownShowing += RibbonButton1_DropDownShowing;
}

private void RibbonButton1_DropDownShowing(object sender, EventArgs e)
{
    // Do something
}

Here is a sample:
WindowsFormsApp1.zip

@leglubert
Copy link
Author

Sorry, but we are misunderstood.

the event exists!

but is not raised if the ribbonButton does not contain at least 1 item in the collection

not practical when you want to create the collection at the runtime:-)

Solution;

  • Create an element in collection at design-time
  • Delete this item from the collection at run-time
  • Add my items to the collection

Amitiés
Lionel

@adriancs2
Copy link
Contributor

adriancs2 commented Oct 10, 2019

If the RibbonButton.DropDownItems is empty, the event will not be raised.
If total items in RibbonButton.DropDownItems is >= 1
The event will be raised.
Tested in runtime.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants