Skip to main content

TabControl Class

NuGet: GHIElectronics.TinyCLR.UI
Assembly: GHIElectronics.TinyCLR.UI
Namespace: GHIElectronics.TinyCLR.UI.Controls

A tabbed container: a strip of tab headers over a body that shows the selected tab's content. Add tabs with AddTab; tapping a header selects it.

public class TabControl : Control

Properties

TabColor

public Color TabColor { get; set; }

Fill of an unselected tab header.

SelectedTabColor

public Color SelectedTabColor { get; set; }

Fill of the selected tab header (and the body).

HeaderColor

public Color HeaderColor { get; set; }

Colour of the header text and separators.

HeaderHeight

public int HeaderHeight { get; set; }

Height in pixels of the tab-header strip.

SelectedIndex

public int SelectedIndex { get; set; }

The index of the visible tab. May be set before tabs are added (it is clamped when rendering).

Methods

AddTab(string header, UIElement content)

public void AddTab(string header, UIElement content)

Adds a tab with the given header text and content element.

MeasureOverride(int availableWidth, int availableHeight, out int desiredWidth, out int desiredHeight)

protected override void MeasureOverride(int availableWidth, int availableHeight, out int desiredWidth, out int desiredHeight)

Measures every tab's content against the body area.

ArrangeOverride(int arrangeWidth, int arrangeHeight)

protected override void ArrangeOverride(int arrangeWidth, int arrangeHeight)

Arranges the selected tab's content in the body; collapses the rest.

OnTouchUp(TouchEventArgs e)

protected override void OnTouchUp(TouchEventArgs e)

Selects the tapped tab header.

OnRender(DrawingContext dc)

public override void OnRender(DrawingContext dc)

Draws the tab-header strip.