Design Office-Inspired Simplified Ribbon in WinForms | Syncfusion Blogs
Live Chat Icon For mobile
Live Chat Icon
Popular Categories.NET  (175).NET Core  (29).NET MAUI  (208)Angular  (109)ASP.NET  (51)ASP.NET Core  (82)ASP.NET MVC  (89)Azure  (41)Black Friday Deal  (1)Blazor  (220)BoldSign  (15)DocIO  (24)Essential JS 2  (107)Essential Studio  (200)File Formats  (67)Flutter  (133)JavaScript  (221)Microsoft  (119)PDF  (81)Python  (1)React  (101)Streamlit  (1)Succinctly series  (131)Syncfusion  (920)TypeScript  (33)Uno Platform  (3)UWP  (4)Vue  (45)Webinar  (51)Windows Forms  (61)WinUI  (68)WPF  (159)Xamarin  (161)XlsIO  (37)Other CategoriesBarcode  (5)BI  (29)Bold BI  (8)Bold Reports  (2)Build conference  (8)Business intelligence  (55)Button  (4)C#  (151)Chart  (132)Cloud  (15)Company  (443)Dashboard  (8)Data Science  (3)Data Validation  (8)DataGrid  (63)Development  (633)Doc  (8)DockingManager  (1)eBook  (99)Enterprise  (22)Entity Framework  (5)Essential Tools  (14)Excel  (41)Extensions  (22)File Manager  (7)Gantt  (18)Gauge  (12)Git  (5)Grid  (31)HTML  (13)Installer  (2)Knockout  (2)Language  (1)LINQPad  (1)Linux  (2)M-Commerce  (1)Metro Studio  (11)Mobile  (508)Mobile MVC  (9)OLAP server  (1)Open source  (1)Orubase  (12)Partners  (21)PDF viewer  (43)Performance  (12)PHP  (2)PivotGrid  (4)Predictive Analytics  (6)Report Server  (3)Reporting  (10)Reporting / Back Office  (11)Rich Text Editor  (12)Road Map  (12)Scheduler  (52)Security  (3)SfDataGrid  (9)Silverlight  (21)Sneak Peek  (31)Solution Services  (4)Spreadsheet  (11)SQL  (11)Stock Chart  (1)Surface  (4)Tablets  (5)Theme  (12)Tips and Tricks  (112)UI  (387)Uncategorized  (68)Unix  (2)User interface  (68)Visual State Manager  (2)Visual Studio  (31)Visual Studio Code  (19)Web  (597)What's new  (333)Windows 8  (19)Windows App  (2)Windows Phone  (15)Windows Phone 7  (9)WinRT  (26)
Design Office-Inspired Simplified Ribbon in WinForms

Design Office-Inspired Simplified Ribbon in WinForms

The Syncfusion WinForms Ribbon control is now available with a simplified layout. It displays the most-used ribbon commands in a single-line interface, allowing more screen space for compact viewing of the content.

For the best user experience, the other ribbon commands can be placed in the overflow menu. You can switch back and forth between the simplified and the normal layouts using the minimize button. This feature became available in our Essential Studio 2020 Volume 4 release.

Why should you prefer the simplified ribbon layout?

The simplified layout:

  • Provides a touch-friendly design.
  • Shows the ribbon items in a single line, providing more vertical space.
  • Allows users to choose ribbon items with less distraction than the normal layout.
  • Shows the exact commands that the user wants, so it’s simple and straightforward to use.

In this blog, we will look at the new simplified ribbon layout feature in the WinForms Ribbon control and the steps to enable its custom features.

Setting up the simplified ribbon layout

Follow these steps to set up the simplified layout in the WinForms Ribbon control:

Step 1: Enable the simplified layout mode in Ribbon control

WinForms Ribbon control renders its items in simplified layout when the LayoutMode property is set to Simplified. The user can switch between simplified and normal layouts at runtime using the built-in minimize button located in the lower-right corner of the Ribbon control. To enable the minimize button, set the EnableSimplifiedLayoutMode property to true as shown in the code example.

private Syncfusion.Windows.Forms.Tools.RibbonControlAdv ribbonControlAdv1;

 this.ribbonControlAdv1 = new RibbonControlAdv();
 this.ribbonControlAdv1.LayoutMode = RibbonLayoutMode.Simplified; 
this.ribbonControlAdv1.EnableSimplifiedLayoutMode = true;

 this.Controls.Add(ribbonControlAdv1);

Refer to the following GIF image.

Switching between normal and simplified layouts
Switching between normal and simplified layouts

Step 2: Set up items for different layouts

Moving ahead, the Ribbon items can be either set as the same among different layouts or can be made visible only in a particular layout by using the SetDisplayMode function in the Ribbon.

By default, the items will be displayed in both normal and simplified layouts. The RibbonItemDisplayMode is a flag of enumeration type that contains the following values:

  • Normal: Displays items in normal layout.
  • Simplified: Displays items in simplified layout.
  • OverflowMenu: Displays items inside the OverflowMenu when the simplified layout is enabled.

Also, the RibbonItemDisplayMode enumeration property allows the following value combinations:

  • Normal, Simplified: Displays items in both normal and simplified layout.
  • Normal, OverflowMenu: Displays items in both normal layout and inside the overflow menu during the simplified layout.
  • Simplified, OverflowMenu: Displays items in simplified layout.
  • Normal, Simplified, OverflowMenu: Displays items in both normal and simplified layouts along with the overflow menu.

Refer to the following code examples.

// To display an item only in simplified layout.
 ToolStripButton pasteButton = new System.Windows.Forms.ToolStripButton();
 pasteButton.Text = "Paste";
 ribbonControlAdv1.SetDisplayMode(pasteButton, RibbonItemDisplayMode.Simplified);
 
 // To display an item only in normal layout.
 ToolStripButton boldButton = new System.Windows.Forms.ToolStripButton();
 boldButton.Text = "Bold";
 ribbonControlAdv1.SetDisplayMode(boldButton, RibbonItemDisplayMode.Normal);
 
 // To display an item in normal layout and inside an overflow menu during the simplified layout.
 ToolStripButton underlineButton = new System.Windows.Forms.ToolStripButton();
 underlineButton.Text = "Underline";
 ribbonControlAdv1.SetDisplayMode(underlineButton, RibbonItemDisplayMode.Normal | RibbonItemDisplayMode.OverflowMenu);
 
 // To display an item both in normal and simplified layout by default.
 ToolStripButton italicButton = new System.Windows.Forms.ToolStripButton();
 italicButton.Text = "Italic";

Step 3: Setting images for Ribbon items

For Normal layout mode, images will be loaded from the item’s image property and their size values can be set using the SetSmallItemImage and SetLargeItemImage functions of the ToolStripExImageProvider class. So, the images will fit inside the Ribbon items based on the display style and image scaling.

The simplified layout mode uses the 20 * 20 image size for the Ribbon items as standard. You can also set the size by using the SetMediumItemImage function in the ToolStripExImageProvider class like in the following code.

ToolStripButton pasteButton = new System.Windows.Forms.ToolStripButton();
 pasteButton.Text = "Paste";
 toolStripEx1.Items.Add(pasteButton);
 
 // Add image for the Paste button for simplified layout to image list.
 ImageListAdv imageListAdv1 = new ImageListAdv(this.components);
 imageListAdv1.Images.Add(Image.FromFile("..//..//Images/Medium Icons/Paste20.png"));
 
 ToolStripExImageProvider toolStripExImageProvider1 = new ToolStripExImageProvider(toolStripEx1);
 // Setting image list to the MediumImageList for the toolStripEx1.
 toolStripExImageProvider1.MediumImageList = imageListAdv1;
 toolStripExImageProvider1.SetMediumItemImage(pasteButton, 0);

Refer to the following screenshot.

Simplified layout of Ribbon with medium size images
Simplified layout of Ribbon with medium size images

Step 4: Add a new RibbonTab or RibbonBar

The Ribbon control allows you to customize the Ribbon and its items through the QAT (quick access toolbar) window, where users can add the Ribbon items to a new ToolStripTabItem or ToolStripEx class. The newly added ToolStripTabItem or ToolStripEx will only be visible in the layout in which the items were added originally.

In the following example, the LayoutMode is set to Simplified and a new ToolStripTabItem named Folder is created and added using the QAT window. This tab will now be visible only in the simplified layout and not in the normal layout that is the default behavior.

Refer to the following screenshots.

Simplified layout with newly added Folder tab
Simplified layout with newly added Folder tab
Normal layout without the newly added Folder tab
Normal layout without the newly added Folder tab

Step 5: Add new items to the QAT

The Ribbon control also allows you to add items to the QAT with the help of the QAT window or through the context menu shortcut. The items added in the normal or simplified layout will always be visible even when switching between layouts.

In the following reference image, the LayoutMode is set to Simplified and the Bold item was added to the QAT through the context menu. This item will now be constantly visible in both normal and simplified layouts.

Simplified layout with the newly added Bold item
Simplified layout with the newly added Bold item
Normal layout with the newly added Bold item
Normal layout with the newly added Bold item

Step 6: Resize the Ribbon control

While resizing the Ribbon, when the width of the window decreases and touches the last positioned item in the Ribbon, the appropriate item will be moved inside the overflow menu automatically. The same behavior will continue for each item when the window is resized continuously.

Refer to the following .gif image.

Resizing the Ribbon
Resizing the Ribbon

References

Documentation link: https://help.syncfusion.com/windowsforms/ribbon/simplifiedlayout

Demo link: https://github.com/SyncfusionExamples/How-to-customize-the-simplified-layout-in-WinForms-RibbonControlAdv

Conclusion

Thanks for reading! In this blog, we have looked at the newly introduced simplified layout and how to enable its custom features in the Syncfusion WinForms Ribbon control. These features will provide different UI layout options and they are available in our Essential Studio 2020 Volume 4 release.

For existing customers, the new Essential Studio version is available for download from the License and Downloads page. If you are not yet a Syncfusion customer, you can try our 30-day free trial to check out our available features.

If you wish to send us feedback or ask any questions, please use the comments section below. You can also contact us through our support forumDirect-Trac, or feedback portal. We are always happy to assist you!

If you like this blog post, we think you’ll like the following blog posts, too:

Tags:

Share this post:

Popular Now

Be the first to get updates

Subscribe RSS feed

Be the first to get updates

Subscribe RSS feed