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

Turn Application Button (Start Button) into a button (No drop down)

2 Answers 89 Views
RibbonBar
This is a migrated thread and some comments may be shown as answers.
DoomerDGR8
Top achievements
Rank 2
Iron
Iron
Iron
DoomerDGR8 asked on 13 Jan 2011, 04:48 PM
Hi, I want to have a About Form displayed when clients clicks the application button on the Ribbon. How do I go about doing that?

2 Answers, 1 is accepted

Sort by
0
Accepted
Nikolay
Telerik team
answered on 13 Jan 2011, 05:05 PM
Hi Hassan,

Thank you for the question.

In order to achieve your requirement, you should subscribe to the Click event of the ApplicationButtonElement:
public Form1()
{
    InitializeComponent();
  
    this.radRibbonBar1.RibbonBarElement.ApplicationButtonElement.Click += new EventHandler(ApplicationButtonElement_Click);
}
  
void ApplicationButtonElement_Click(object sender, EventArgs e)
{
    Form f = new Form();
    f.BackColor = Color.Yellow;
    f.Show();
}

I hope that you will find this information helpful.

Greetings,
Nikolay
the Telerik team
Q3’10 SP1 of RadControls for WinForms is available for download; also available is the Q1'11 Roadmap for Telerik Windows Forms controls.
0
DoomerDGR8
Top achievements
Rank 2
Iron
Iron
Iron
answered on 13 Jan 2011, 05:22 PM
Thanks for the reply.

Figured it out just a few minutes before your reply.

RadRibbonBarMain.RibbonBarElement.ApplicationButtonElement.Click += new EventHandler(ApplicationButtonElement_Click);
RadRibbonBarMain.RibbonBarElement.ApplicationButtonElement.DropDownMenu.DropDownOpening += new System.ComponentModel.CancelEventHandler(DropDownMenu_DropDownOpening);
 
void ApplicationButtonElement_Click(object sender, EventArgs e) {
    using (AboutForm newDialog = new AboutForm()) {
        newDialog.ShowDialog(this);
    }
}
 
void DropDownMenu_DropDownOpening(object sender, System.ComponentModel.CancelEventArgs e) {
    e.Cancel = true;
}

Has to subscribe to both event to kill the drop down menu completely.
Tags
RibbonBar
Asked by
DoomerDGR8
Top achievements
Rank 2
Iron
Iron
Iron
Answers by
Nikolay
Telerik team
DoomerDGR8
Top achievements
Rank 2
Iron
Iron
Iron
Share this question
or