$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 > Manage Contextual Tab Groups in C# in C#

Adding and Customizing Contextual Tab Groups in C#.NET

KetticRibbonBar allows the designers to group tabs in a context by using the Contextual Tab Groups. This functionality will enhance the user interface of the RibbonBar control. The users of the KetticRibbonBar control can easily add the Contextual Tab Groups to the KetticRibbonBar by using C# code. In this article, we are going through how to manage the contextual tab groups programmatically in C#.NET template projects.

Add Contextual Tab Groups using the Designer

When the users of the control want to add contextual tab groups to KetticRibbonBar control, they can use the Visual Studio designer to achieve this. The users can use either one of the following two ways to add contextual tab groups to RibbonBar in designer.
  • The users are able to add contextual tab groups to RibbonBar control by using the Add New Group. This is achieved by Clicking on Add New Group, input a name for the contextual tab group, and then pressing Enter.
  • Alternatively, the users can use the collection editor. The collection editor can be opened by choosing the ContextualTabGroups property of KetticRibbonBar. And then click Add button and input a name to the Text property for the contextual tab group and click OK button.

Assign Tabs to a Contextual Tab Group using the Designer

When the users of the control want to assign tabs to contextual tab groups in the Visual Studio designer, they can follow the two ways as below.
  • Drag the tab and drop it to the contextual tab group
  • Open the Properties window of the Contextual Tab Group and open the Collection Editor of the TabItems property. And then place the tab from the available Ribbon Tabs in the Contextual Tab Group

Program Contextual Tabs in C# code

The C# code below demonstrates how to create contextual tab groups and assign tabs to contextual tab groups in C#.NET template project.

private Kettic.WinForms.UI.RibbonTab ribbonTab1;
private Kettic.WinForms.UI.RibbonTab ribbonTab2;
private Kettic.WinForms.UI.RibbonTab ribbonTab3;
private Kettic.WinForms.UI.ContextualTabGroup contextualTabGroup1;
private Kettic.WinForms.UI.ContextualTabGroup contextualTabGroup2;

void Form1_Load(object sender, EventArgs e)
this.ribbonTab1 = new Kettic.WinForms.UI.RibbonTab();
this.ribbonTab2 = new Kettic.WinForms.UI.RibbonTab();
this.ribbonTab3 = new Kettic.WinForms.UI.RibbonTab();

ribbonTab1.Text = "Tab A";
ribbonTab2.Text = "Tab B";
ribbonTab3.Text = "Tab C";

this.contextualTabGroup1 = new Kettic.WinForms.UI.ContextualTabGroup();
this.contextualTabGroup2 = new Kettic.WinForms.UI.ContextualTabGroup();

this.ketticRibbonBar1.CommandTabs.AddRange(new Kettic.WinForms.UI.RibbonTab[] { ribbonTab1, ribbonTab2, ribbonTab3});

this.ketticRibbonBar1.ContextualTabGroups.AddRange(new Kettic.WinForms.KetticItem[] { this.contextualTabGroup1, this.contextualTabGroup2 });


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