Skip to main content
Version: 4.1

TabControlExtensions

Namespace: Wisej.Web.Markup

Assembly: Wisej.Framework (4.1.0.0)

Adds fluent markup extension methods to the TabControl class.

public class TabControlExtensions

Methods

Static member Alignment<TTabControl>(tabControl, alignment)

Sets the Alignment property of the specified TabControl.

ParameterTypeDescription
TTabControlThe type of the tab control, must inherit from TabControl.
tabControlTTabControlThe tab control for which to set the Alignment property.
alignmentTabAlignmentThe TabAlignment to set for the tab control.

Returns: TTabControl. The modified tab control with the updated Alignment property.

This method allows you to specify the alignment of the tabs in the tab control.


myTabControl.Alignment(TabAlignment.Bottom);

Static member BorderStyle<TTabControl>(tabControl, borderStyle)

Sets the BorderStyle property of the specified TabControl.

ParameterTypeDescription
TTabControlThe type of the tab control, must inherit from TabControl.
tabControlTTabControlThe tab control for which to set the BorderStyle property.
borderStyleBorderStyleThe BorderStyle to set for the tab control.

Returns: TTabControl. The modified tab control with the updated BorderStyle property.

This method allows you to specify the border style of the tab control.


myTabControl.BorderStyle(BorderStyle.FixedSingle);

Static member ItemSize<TTabControl>(tabControl, size)

Sets the ItemSize property of the specified TabControl.

ParameterTypeDescription
TTabControlThe type of the tab control, must inherit from TabControl.
tabControlTTabControlThe tab control for which to set the ItemSize property.
sizeSizeThe Size to set for each tab item.

Returns: TTabControl. The modified tab control with the updated ItemSize property.

This method allows you to specify the size of each tab item in the tab control.


myTabControl.ItemSize(new Size(100, 50));

Static member OnDeselected<TTabControl>(tabControl, action)

Attaches an event handler for the Deselected event of the specified TabControl.

ParameterTypeDescription
TTabControlThe type of the tab control, must inherit from TabControl.
tabControlTTabControlThe tab control to attach the event handler to.
actionAction<TTabControl, TabControlEventArgs>An action to execute when a tab is deselected.

Returns: TTabControl. The modified tab control with the attached Deselected event handler.

This method allows you to execute a custom action whenever a tab is deselected.


myTabControl.OnDeselected((tc, args) =>
{
AlertBox.Show("Tab deselected!");
});

Static member OnDeselecting<TTabControl>(tabControl, action)

Attaches an event handler for the Deselecting event of the specified TabControl.

ParameterTypeDescription
TTabControlThe type of the tab control, must inherit from TabControl.
tabControlTTabControlThe tab control to attach the event handler to.
actionAction<TTabControl, TabControlCancelEventArgs>An action to execute when a tab is being deselected.

Returns: TTabControl. The modified tab control with the attached Deselecting event handler.

This method allows you to execute a custom action whenever a tab is being deselected.


myTabControl.OnDeselecting((tc, args) =>
{
AlertBox.Show("Tab deselecting!");
});

Static member OnSelected<TTabControl>(tabControl, action)

Attaches an event handler for the Selected event of the specified TabControl.

ParameterTypeDescription
TTabControlThe type of the tab control, must inherit from TabControl.
tabControlTTabControlThe tab control to attach the event handler to.
actionAction<TTabControl, TabControlEventArgs>An action to execute when a tab is selected.

Returns: TTabControl. The modified tab control with the attached Selected event handler.

This method allows you to execute a custom action whenever a tab is selected.


myTabControl.OnSelected((tc, args) =>
{
AlertBox.Show("Tab selected!");
});

Static member OnSelecting<TTabControl>(tabControl, action)

Attaches an event handler for the Selecting event of the specified TabControl.

ParameterTypeDescription
TTabControlThe type of the tab control, must inherit from TabControl.
tabControlTTabControlThe tab control to attach the event handler to.
actionAction<TTabControl, TabControlCancelEventArgs>An action to execute when a tab is being selected.

Returns: TTabControl. The modified tab control with the attached Selecting event handler.

This method allows you to execute a custom action whenever a tab is being selected.


myTabControl.OnSelecting((tc, args) =>
{
AlertBox.Show("Tab selecting!");
});

Static member SelectedIndex<TTabControl>(tabControl, value)

Sets the SelectedIndex property of the specified TabControl.

ParameterTypeDescription
TTabControlThe type of the tab control, must inherit from TabControl.
tabControlTTabControlThe tab control for which to set the SelectedIndex property.
valueInt32The index of the tab to select.

Returns: TTabControl. The modified tab control with the updated SelectedIndex property.

This method allows you to specify the index of the tab to select.


myTabControl.SelectedIndex(1);

Static member ShowToolTips<TTabControl>(tabControl, value)

Sets the ShowToolTips property of the specified TabControl.

ParameterTypeDescription
TTabControlThe type of the tab control, must inherit from TabControl.
tabControlTTabControlThe tab control for which to set the ShowToolTips property.
valueBooleanA boolean indicating whether tooltips are shown for the tabs.

Returns: TTabControl. The modified tab control with the updated ShowToolTips property.

This method allows you to enable or disable the display of tooltips for the tabs in the tab control.


myTabControl.ShowToolTips(true);

Static member SizeMode<TTabControl>(tabControl, sizeMode)

Sets the SizeMode property of the specified TabControl.

ParameterTypeDescription
TTabControlThe type of the tab control, must inherit from TabControl.
tabControlTTabControlThe tab control for which to set the SizeMode property.
sizeModeTabSizeModeThe TabSizeMode to set for the tab control.

Returns: TTabControl. The modified tab control with the updated SizeMode property.

This method allows you to specify the size mode of the tabs in the tab control.


myTabControl.SizeMode(TabSizeMode.Fixed);

Static member TabPages<TTabControl>(tabControl, tabPages)

Adds the specified tab pages to the TabPages collection of the specified TabControl.

ParameterTypeDescription
TTabControlThe type of the tab control, must inherit from TabControl.
tabControlTTabControlThe tab control to which the tab pages should be added.
tabPagesTabPage[]An array of TabPage to add to the tab control.

Returns: TTabControl. The modified tab control with the added tab pages.

This method allows you to add multiple tab pages to the tab control in one call.


myTabControl.TabPages(new TabPage("Tab1"), new TabPage("Tab2"));