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

How to automatically hide button in start menu after clicking it?

1 Answer 148 Views
RibbonBar
This is a migrated thread and some comments may be shown as answers.
Nismah
Top achievements
Rank 1
Nismah asked on 18 Jul 2016, 12:28 PM
Hey
I added a button in the start menu of RadRibbonBar. The problem is the button stays visible on the screen even after clicking it. How do I hide the start menu after the button is clicked?

1 Answer, 1 is accepted

Sort by
0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 19 Jul 2016, 08:39 AM
Hello Nismah,

Thank you for writing. 

Please refer to the following code snippet demonstrating how close the application menu's popup when clicking the button:
public Form1()
{
    InitializeComponent();
 
    RadApplicationMenuDropDown menu = this.radRibbonBar1.RibbonBarElement.ApplicationButtonElement.DropDownMenu as RadApplicationMenuDropDown;
 
    RadButtonElement btn = new RadButtonElement();
    btn.Text = "Click";
    btn.Click += btn_Click;
    menu.ButtonItems.Add(btn);
}
 
private void btn_Click(object sender, EventArgs e)
{
    RadApplicationMenuDropDown menu = this.radRibbonBar1.RibbonBarElement.ApplicationButtonElement.DropDownMenu as RadApplicationMenuDropDown;
    menu.ClosePopup(RadPopupCloseReason.Mouse);
}

I hope this information helps. Should you have further questions I would be glad to help.

Regards,
Dess
Telerik by Progress
Check out the Windows Forms project converter, which aids the conversion process from standard Windows Forms applications written in C# or VB to Telerik UI for WinForms.For more information check out this blog post and share your thoughts.
Tags
RibbonBar
Asked by
Nismah
Top achievements
Rank 1
Answers by
Dess | Tech Support Engineer, Principal
Telerik team
Share this question
or