Live Chat Icon For mobile
Live Chat Icon
Popular Categories.NET  (147).NET Core  (24)Angular  (41)ASP.NET  (48)ASP.NET Core  (55)ASP.NET MVC  (84)Azure  (28)Blazor  (62)DocIO  (18)Essential JS 2  (65)Essential Studio  (160)Flutter  (71)JavaScript  (137)Microsoft  (100)PDF  (53)React  (30)Succinctly series  (120)Syncfusion  (448)TypeScript  (30)Uno Platform  (2)UWP  (4)Vue  (26)Webinar  (15)Windows Forms  (54)WPF  (103)Xamarin  (112)XlsIO  (20)Other CategoriesBarcode  (4)BI  (29)Bold BI  (3)Build conference  (6)Business intelligence  (53)Button  (4)C#  (101)Chart  (43)Cloud  (9)Company  (445)Dashboard  (6)Data Science  (3)Data Validation  (3)DataGrid  (33)Development  (243)Doc  (7)DockingManager  (1)eBook  (91)Enterprise  (22)Entity Framework  (5)Essential Tools  (14)Excel  (15)Extensions  (9)File Manager  (3)Gantt  (7)Gauge  (4)Git  (3)Grid  (25)HTML  (8)Installer  (1)Knockout  (2)LINQPad  (1)Linux  (1)M-Commerce  (1)Metro Studio  (11)Mobile  (166)Mobile MVC  (9)OLAP server  (1)Open source  (1)Orubase  (12)Partners  (21)PDF viewer  (18)Performance  (2)PHP  (1)PivotGrid  (4)Predictive Analytics  (6)Report Server  (3)Reporting  (10)Reporting / Back Office  (11)Rich Text Editor  (5)Road Map  (9)Scheduler  (17)SfDataGrid  (8)Silverlight  (21)Sneak Peek  (12)Solution Services  (2)Spreadsheet  (2)SQL  (4)Stock Chart  (1)Surface  (4)Tablets  (5)Theme  (9)Tips and Tricks  (37)UI  (91)Uncategorized  (68)Unix  (2)User interface  (62)Visual State Manager  (1)Visual Studio  (15)Visual Studio Code  (8)Web  (135)What's new  (84)Windows 8  (19)Windows App  (1)Windows Phone  (15)Windows Phone 7  (9)WinRT  (26)
Share on twitter
Share on facebook
Share on linkedin
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:

Share on twitter
Share on facebook
Share on linkedin

Leave a comment

Popular Now

Be the first to get updates

Subscribe RSS feed
Scroll To Top