Class TabControl
- Namespace
- Myra.Graphics2D.UI
- Assembly
- Myra.dll
A tab control widget that displays multiple tab items with selector buttons and swappable content panels.
public class TabControl : Selector<Grid, TabItem>, IItemWithId, INotifyAttachedPropertyChanged
- Inheritance
-
TabControl
- Implements
- Inherited Members
Constructors
TabControl(Stylesheet, string)
Initializes a new instance of the TabControl class with the specified stylesheet and style.
public TabControl(Stylesheet stylesheet, string styleName = "")
Parameters
stylesheetStylesheetThe stylesheet to use for applying the style.
styleNamestringThe name of the style to apply to the tab control.
TabControl(string)
Initializes a new instance of the TabControl class.
public TabControl(string styleName = "")
Parameters
styleNamestringThe name of the style to apply to the tab control.
Properties
ClipToBounds
Gets or sets a value indicating whether content extending beyond the tab control bounds is clipped.
public override bool ClipToBounds { get; set; }
Property Value
CloseableTabs
Gets or sets a value indicating whether each tab has a close button.
public bool CloseableTabs { get; set; }
Property Value
HorizontalAlignment
Gets or sets the horizontal alignment of the tab control within its parent container.
public override HorizontalAlignment HorizontalAlignment { get; set; }
Property Value
SelectionMode
Gets or sets the selection mode for tabs.
[Browsable(false)]
public override SelectionMode SelectionMode { get; set; }
Property Value
TabControlStyle
Gets or sets the style applied to the tab control.
[Browsable(false)]
public TabControlStyle TabControlStyle { get; set; }
Property Value
TabSelectorPosition
Gets or sets the position of the tab selector buttons (top, bottom, left, or right).
public TabSelectorPosition TabSelectorPosition { get; set; }
Property Value
VerticalAlignment
Gets or sets the vertical alignment of the tab control within its parent container.
public override VerticalAlignment VerticalAlignment { get; set; }
Property Value
Methods
ApplyStyle(WidgetStyle)
Applies the specified widget style to this tab control.
protected override void ApplyStyle(WidgetStyle style)
Parameters
styleWidgetStyleThe widget style to apply.
CopyFrom(Widget)
Copies the tab control properties and items from another tab control.
protected override void CopyFrom(Widget w)
Parameters
wWidgetThe source tab control to copy from.
InsertItem(TabItem, int)
Inserts a tab item at the specified index in the tab control.
protected override void InsertItem(TabItem item, int index)
Parameters
itemTabItemThe tab item to insert.
indexintThe zero-based index where the item should be inserted.
OnSelectedItemChanged()
Called when the selected tab item changes. Updates the displayed content.
protected override void OnSelectedItemChanged()
RemoveItem(TabItem)
Removes the specified tab item from the tab control.
protected override void RemoveItem(TabItem item)
Parameters
itemTabItemThe tab item to remove.
Reset()
Clears all tab items from the tab control.
protected override void Reset()