$99 VS $1000+. UI Control for ASP.NET AJAX(contains chart and gridview).
RibbonBar Control for Windows Forms
Create innovative user interfaces and build Office 2007 and 2010 ribbon bar design
Home > WinForms UI Controls > User Manual > Customize Application Menu in C# in C#

Customize Application Menu for RibbonBar in C#.NET

KetticRibbonBar control provides the support of application menu, which will be shown in the upper left corner of the KetticRibbonBar as the users click on the Office button. The application menu is a fully customizable menu. It will help the designers to build cool custom application with ease of use access to document, form, or application. The application menu support allows the designers to build user interface of Office 2007 ribbon at design time and more extended features.

C# Add Image to Application Menu Office Button

KetticRibbonBar WinForms control includes the KetticRibbonBar.StartButtonImage property for the designers to assign image to the Application Menu button. The C# code below demonstrates how to add image to the button.

ketticRibbonBar1.StartButtonImage = new Bitmap("..\\Sample\\moon.png");

C# Add Items to the Application Menu

KetticRibbonBar control offers different menu items for the users to create a menu and add it to the Application Menu, such as KetticMenuItem, KetticMenuButtonItem, KetticMenuHeaderItem, KetticMenuSeperatorItem, and KetticMenuComboItem. The C# code below shows how to create a new KetticMenuItem, which is a standard menu, and add the menu to the application menu.

C# code for creating and adding a new menu item


KetticMenuItem mnuNew = new KetticMenuItem("New Menu");
mnuNew.Click += new EventHandler(NewMenu);
ketticRibbonBar1.StartMenuItems.Add(mnuNew);

C# code for handling the menu item click event


void NewFile(object sender, EventArgs e)
{
MessageBox.Display("New Menu");
}

C# Add Items to the Right Column

KetticRibbonBar control provides the KetticRibbonBar.StartMenuRightColumnItems collection for the designers to add the created items in the right column of the Application Menu. The C# code below shows how to place items to the right column.

KetticMenuItem mnuRecentDocs = new KetticMenuItem("Recent Documents");
mnuRecentDocs.Enabled = false;
ketticRibbonBar1.StartMenuRightColumnItems.Add(mnuRecentDocs);

C# Add Items with Sub Items

When we want to add items to sub items, we need to create a submenu under a main menu item and then add items to the Items collection of the main KetticMenuItem. The C# code below demonstrates how to add a KetticMenuItem, mnuPrint, to the start menu and create a sub menu with two KetticMenuItems with click event handlers.

KetticMenuItem mnuPrint = new KetticMenuItem("Print");
ketticRibbonBar1.StartMenuItems.Add(mnuPrint);

KetticMenuItem mnuPrintsubPrint = new KetticMenuItem("Print");
mnuPrintsubPrint.Click += new EventHandler(Print);
KetticMenuItem mnuPrintsubPreview = new KetticMenuItem("Print Preview");
mnuPrintsubPreview.Click += new EventHandler(Preview);

mnuPrint.Items.AddRange(new KetticMenuItem[] {mnuPrintsubPrint, mnuPrintsubPreview});

Wrap Description Text of Items using C# code

KetticRibbonBar Application Menu contains TextWrap property for wrapping description texts of the menu items. The steps below show how to set text wrap for menu items
  • Enable the TextWrap property of the Text and Description for text wrapping.
  • Set MaxSize to the Text and Description parts.
  • Modify the ApplicationMenuRightColumnWidth property to set an appropriate width to the right column.
UI Controlsfor Windows Forms
.NET WinForms UI Overview.NET WinForms UI Features.NET WinForms UI GuideC# WinForms UI DesignVB.NET WinForms UI Design
WinForms UI Controls