Class TabControl
Represents a control that manages a related set of tab pages.
[ControlCategory("Containers")]
public class TabControl : Control, IBaseObject, IDisposableObject, IInputElement, ISupportInitialize, IFocusable, IWin32Window, ITextProperty, IComponent, IDisposable
- Inheritance
-
TabControl
- Implements
- Extension Methods
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.
Properties
- ContentElements
Returns a collection of content elements which is used by the UIXML loader to find content items by index.
- ControlKind
Returns control identifier.
- LogicalChildrenCollection
Returns a collection of elements which can be treated as "logical children" of this element.
- Pages
Gets the collection of tab pages in this tab control.
- SelectedPage
Gets or sets the currently selected tab page.
- SelectedPageIndex
Gets the currently selected tab page index.
- TabAlignment
Gets or sets the area of the control (for example, along the top) where the tabs are aligned.
Methods
- OnParentChanged(EventArgs)
Raises the ParentChanged event.
- OnSelectedPageChanged(EventArgs)
A virtual function that is called when the selection is changed. Default behavior is to raise a SelectedPageChangedEvent
Events
- PageAdded
Occurs when new page was added.
- SelectedPageChanged
Occurs when the SelectedPage property has changed.