Table of Contents

Class TabControl

Namespace
Alternet.UI
Assembly
Alternet.UI.Common.dll

Represents a control that manages a related set of tab pages.

[ControlCategory("Containers")]
public class TabControl : Control, IBaseObjectWithId, IDisposableObject, IBaseObject, ISupportInitialize, IFocusable, ITextProperty, IComponent, IControl, IDisposable, IWin32Window, INotifyDataErrorInfo
Inheritance
TabControl
Implements
Derived

Examples

Here is how to declare a TabControl in UIXML:

<TabControl SuggestedHeight="150" Name="tabControl" Margin="8">
  <TabPage Title="Page 1"></TabPage>
  <TabPage Title="Page 2"></TabPage>
  <TabPage Title="Page 3"></TabPage>
  <TabPage Title="Page 4"></TabPage>
  <TabPage Title="Page 5"></TabPage>
</TabControl>

Also, a TabControl can be created from code:

var tc = new Alternet.UI.TabControl();
tc.SuggestedSize = (250, 300);
tc.Pages.Add(new TabPage { Title = "Page 1"});
tc.Pages.Add(new TabPage { Title = "Page 2" });
tc.Pages.Add(new TabPage { Title = "Page 3" });
tc.Pages.Add(new TabPage { Title = "Page 4" });
tc.Pages.Add(new TabPage { Title = "Page 5" });
tc.Parent = mainPanel;

Remarks

Examples of how a TabControl can look on different platforms:

Constructors

TabControl()

Initializes a new instance of the TabControl class.

TabControl(Control)

Initializes a new instance of the TabControl class.

Fields

DefaultMinTabSize

Gets or sets default minimal tab size in the header.

Properties

Appearance

Gets or sets the visual appearance of the control's tabs.

ContentElements

Returns a collection of content elements which is used by the UIXML loader to find content items by index.

ContentPadding

Gets or sets padding of contents.

ContentVisible

Gets or sets whether contents of the control is visible. If contents is hidden only tab headers are shown.

ControlKind

Returns control identifier.

DisplayRectangle

Gets the display area of the control's tab pages.

HasInteriorBorder

Gets or sets whether tab interior border is visible.

IsVertical

Gets or sets how the tabs and content are aligned.

LoadedPages

Gets the collection of the loaded pages.

LogicalChildrenCollection

Returns a collection of elements which can be treated as "logical children" of this element.

Padding

Gets or sets the padding inside a control.

Pages

Gets the collection of tab pages in this tab control.

SelectedControl

Gets selected tab page.

SelectedIndex

Gets or sets the index of the currently selected tab page.

SelectedPage

Gets or sets the currently selected tab page.

SizeMode

Gets or sets the way that the control's tabs are sized.

TabAlignment

Gets or sets the area of the control (for example, along the top) where the tabs are aligned.

TabCount

Gets the number of tabs in the tab strip.

TabPaintAlignment

Gets or sets alignment override used when tabs are painted.

TabTheme

Gets or sets colors and styles theme of the tabs.

TabsVisible

Gets or sets whether tab titles are visible.

Methods

Add(AbstractControl)

Adds new page.

Add(NameValue<AbstractControl>)

Adds new page.

Add(NameValue<Func<AbstractControl>>)

Adds new page.

Add(string, AbstractControl?)

Adds new page.

Add(string, Func<AbstractControl>)

Adds new page.

AddRange(IEnumerable<NameValue<AbstractControl>>)

Adds new pages.

AddRange(IEnumerable<NameValue<Func<AbstractControl>>?>)

Adds new pages.

GetControlAt(int?)

Gets tab page at the specified index.

GetDefaultInteriorBorderColor()

Gets default interior border color as light/dark color pair.

GetInteriorBorderColor()

Gets interior border color.

GetTabIndex(AbstractControl?)

Gets index of the tab page or null if control is not found in tabs.

GetTitle(int?)

Gets title of the specified tab page.

Insert(int?, AbstractControl)

Inserts new page at the specified index.

Insert(int?, string, AbstractControl?)

Inserts new page at the specified index.

OnChildPropertyChanged(AbstractControl, string, bool)

Called by the child control when its property is changed.

OnPaint(PaintEventArgs)

Called when the control is redrawn. See Paint for details.

OnSizeChanged(EventArgs)

Called when the SizeChanged event.

Remove(AbstractControl)

Removes tab page from the control.

RemoveAll()

Removed all items from the control.

RemoveAt(int?)

Removes tab page with the specified index.

SelectFirstTab()

Selects the first tab if it exists.

SelectTab(int?)

Selects tab with the specified index.

SetTabImage(int?, Image?, Image?)

Sets images for the tab.

SetTabImage(int?, ImageSet?, ImageSet?)

Sets images for the tab.

SetTitle(int?, string?)

Sets title of the specified tab page.

Events

SelectedIndexChanged

Occurs when the SelectedIndex property has changed.

SelectedPageChanged

Occurs when the selected page has changed.

TabSizeChanged

Occurs when the size of the tab has changed.