DevExpress: Ribbon Control in C#

This post shows you how to create a ribbon form using devexpress ribbon control in c#.net windows forms application.

The Ribbon Control replaces traditional toolbars and menus with tabbed pages. Each Page splits into Groups that contain various command buttons.

To play the demo, you should create a new windows forms application project, then add a ribbon form to your project as shown below.

If you have not yet installed DevExpress .NET products, you can view How to download and install DevExpress

Enter your ribbon form as the main form with name is frmMain.

devexpress ribbon control

Drag the ImageCollection, DocumentManager and DefaultLookAndFeel from the visual studio toolbox to your main form.

The ImageCollection control allows you to add images and display the images to another control, the you can add the ImageCollection to the Ribbon form to display images for items.

The DocumentManager allows you to manage your form in the tabbed pages.

The DefaultLookAndFeel allows you to change theme for the windows forms application.

Next, To create the Module1 form you can right click on your project, then add the new XtraForm. You can add the LayoutControl to your XtraForm, then drag the TextBoxEdit, GridControl from devexpress toolbox into your LayoutControl.

Your module 1 name: frmModule1

devexpress ribbon control

Do the same way for Module2 and Module3 forms.

Your module 2 name: frmModule2

devexpress ribbon control

Your module 3 name: frmModule3

devexpress ribbon control

And don't forget to set your main form is the MDI form. Next, add code to handle your main form as shown below.

using DevExpress.XtraBars;

namespace RibbonDemo
{
    public partial class frmMain : DevExpress.XtraBars.Ribbon.RibbonForm
    {
        public frmMain()
        {
            InitializeComponent();
        }

        private void barButtonItem3_ItemClick(object sender, ItemClickEventArgs e)
        {
            frmModule1 frm = new frmModule1();
            frm.MdiParent = this;
            frm.Show();
        }

        private void barButtonItem2_ItemClick(object sender, ItemClickEventArgs e)
        {
            frmModule2 frm = new frmModule2();
            frm.MdiParent = this;
            frm.Show();
        }

        private void barButtonItem1_ItemClick(object sender, ItemClickEventArgs e)
        {
            frmModule3 frm = new frmModule3();
            frm.MdiParent = this;
            frm.Show();
        }
    }
}

So, Through the above example, you have learned how to use ribbon control in c# windows application and devexpress tabbed form.

VIDEO TUTORIAL