Version

Adding New Tab Button

Topic Overview

Purpose

This topic introduces the ability to allow users to add a new tab button at runtime on the WinTabStrip and WinTab controls.

In this topic

This topic contains the following sections:

Adding New Tab Button

Introduction

Similar to the tabs found on contemporary browsers, this feature allows the user to add new tabs while the application is up and running. To configure this feature both the WinTabStrip and WinTab controls exposes the NewTabButtonLocation property.

The NewTabButtonLocation property has three option settings:

Option Description

None

No new tab button is set to be visible (Default).

Adding New Tab Button 1.png

End

New tab button is added at the end of the tabs.

Adding New Tab Button 2.png

Start

New tab button is added at the beginning of the tabs.

Adding New Tab Button 3.png

AfterTabs

New tab button is added after the last tab.

Adding New Tab Button 4.png

Enabling new tab button location

The NewTabButtonLocation property can be set using either the Visual Studio designer or in code.

Adding New Tab Button 5.png

An example of configuring the new tab button location in code behind.

In C#:

ultraTabControl1.NewTabButtonLocation = NewTabButtonLocation.AfterTabs;

In Visual Basic:

ultraTabControl1.NewTabButtonLocation = NewTabButtonLocation.AfterTabs

Events

The following events have been added to the UltraTabControlBase class.

Event Description

This event allows you to disable the new tab from being added by handling the event and setting the Cancel property of the EventArgs argument to True .

This event allows you to enable users to crate and populate the new tab by handling the event and referencing the Tab property of the EventArgs argument.

Styling

The new tab button supports AppStylist by adding a new role called, NewTabButton to enable the styling of the new tab button’s appearance.

Adding New Tab Button 6.png

Related Content

Topics

The following topic provides additional information related to this topic.

Topic Purpose

In this section, you’ll find short, task-based topics that explain how to perform a specific task related to the WinTab and WinTabStrip controls.