Solved! Go to solution

Help event of RibbonButton is not fired C#


I want to show a help file if the user presses the F1 button.

So I used the following Code:

class MyRibbon : SolidEdgeCommunity.AddIn.Ribbon
    private RibbonButton _button1;

public MyRibbon() { // Get a reference to the current assembly. This is where the ribbon XML is embedded. var assembly = System.Reflection.Assembly.GetExecutingAssembly(); // Note: In this example, the ribbon XML file has a build action of "Embedded Resource". var _embeddedResourceName = String.Format("{0}.xml", this.GetType().FullName); this.LoadXml(assembly, _embeddedResourceName); // Example of how to bind a local variable to a particular ribbon control. _button1 = GetButton(0); _button1.Help += _button1_Help; } void _button1_Help(RibbonControl control, IntPtr hWndFrame, int helpCommandID) { Help.ShowHelp(null, "Help.chm"); } }

But the event is never fired when running the program.

The method "_button1_Help" is never called.

Does anyone of you guys have experience with this problem and knows how to fix it?


Kind regards,


Accepted by topic author loginator
‎12-07-2016 07:06 AM

Re: Help event of RibbonButton is not fired C#

I noticed that its not the right event that was called. I made a pull request on GitHub with a fix to this.

The pull request was accepted so you should be able to use the webHelpUrl attribute in the XML schema or set the WebHelpUrl property of a RibbonControl and link it to a Website that gets called by hitting the F1 button.