This is a migrated thread and some comments may be shown as answers.

Help Button Event in RadRibbonBarForm

4 Answers 56 Views
RibbonBar
This is a migrated thread and some comments may be shown as answers.
Kun
Top achievements
Rank 2
Kun asked on 25 Jan 2019, 11:19 AM

Hello,

My form is RadRibbonBarForm. Me.HelpButtonClicked cannot be fired when I click the help button in RadRibbonBar.

I found out RadRibbonBar.HelpButton.Click can handle the help button click event.

Does Me.HelpButtonClicked event not work any more in RadRibbonBarForm ?

One more question, why VS doesn't accept the definition of the event:

Private Sub RibbonBtn_Help_Click(sender As Object, e As EventArgs) Handles RadRibbonBar1.HelpButton.Click
'---Bla bla
End Sub

 

But it accepts only wire the event like this :

Private Sub FrmMain_Load(sender As Object, e As EventArgs)
    AddHandler RadRibbonBar1.HelpButton.Click, AddressOf RibbonBtn_Help_Click
End Sub
 
Private Sub RibbonBtn_Help_Click(sender As Object, e As EventArgs)
'----Bla bla
End Sub

 

What's the different ?

Thank you by advance.

 

 

 

 

4 Answers, 1 is accepted

Sort by
0
Dimitar
Telerik team
answered on 25 Jan 2019, 12:31 PM
Hi Kun,

This works fine on my side with the latest version. For convenience, I prepared a small sample, based on the information that you provided so far and attached it to this thread. Could you please check it and let me know how it differs from your real setup? 

In the event hanlder definition, you need to use CancelEventArgs. Setting the Cancel property to true will remove the question mark from the mouse cursor. 

I am looking forward to your reply.

Regards,
Dimitar
Progress Telerik
Get quickly onboard and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
Kun
Top achievements
Rank 2
answered on 28 Jan 2019, 10:03 AM

Hello Dimitar,

Unfortunately, I haven't resolved my problem by your demo. I wrote a small demo. 

In my demo, a message box will be displayed when the help button is clicked.

I used two different handlers to fire the event. But only one worked. Please check it out.

Can you tell me why this.HelpButtonClicked can not be fired ?

I can't upload the .rar file. You can download by this dropbox link:

https://www.dropbox.com/s/2uwo3unfsxbjb4o/TelerikHelpButton.rar?dl=0

using System;
using System.ComponentModel;
 
namespace TelerikHelpButton
{
    public partial class RadRibbonForm1 : Telerik.WinControls.UI.RadRibbonForm
    {
        public RadRibbonForm1()
        {
            InitializeComponent();
             
        }
 
        private void HelpButton_click(object sender, CancelEventArgs e)
        {
            Telerik.WinControls.RadMessageBox.Show("Help Button Clicked");
 
        }
 
        private void RadHelpButton_click(object sender, EventArgs e)
        {
            Telerik.WinControls.RadMessageBox.Show("Rad Help Button Clicked");
        }
 
        private void RadRibbonForm1_Load(object sender, EventArgs e)
        {
            this.HelpButtonClicked += new CancelEventHandler(this.HelpButton_click);
            this.radRibbonBar1.HelpButton.Click += new EventHandler(this.RadHelpButton_click);
        }
    }
}

Thank you by advance.

0
Accepted
Dimitar
Telerik team
answered on 28 Jan 2019, 12:26 PM
Hello Kun,

There are 2 help buttons in the ribbon (see attached) and the HelpButtonClicked event will fire if you click the help button in the title bar. Here is how you can show the help button manually:
this.HelpButton = true;
this.AllowAero = false;
this.radRibbonBar1.RibbonBarElement.RibbonCaption.HelpButton.Visibility = Telerik.WinControls.ElementVisibility.Visible;

Should you have any other questions do not hesitate to ask.

Regards,
Dimitar
Progress Telerik
Get quickly onboard and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
Kun
Top achievements
Rank 2
answered on 28 Jan 2019, 01:14 PM
Thank you for your help, Dimitar.
Tags
RibbonBar
Asked by
Kun
Top achievements
Rank 2
Answers by
Dimitar
Telerik team
Kun
Top achievements
Rank 2
Share this question
or