TabControl
class cAlgo.API Since 5.2
Represents the Tab control.
Environment behaviour
CLI — not supported. Accepted without error but never displayed, so control events such as Click are never raised.
Cloud — not supported. Accepted without error but never displayed, so control events such as Click are never raised.
Definition
public class TabControl : Control
Namespace: cAlgo.API · Group: Controls · Inherits: Control, ControlBase
Examples
using cAlgo.API;
namespace cAlgo.Robots;
public partial class TestExample : Robot
{
protected override void OnStart()
{
var tabControl = new TabControl
{
HorizontalAlignment = HorizontalAlignment.Center,
VerticalAlignment = VerticalAlignment.Center,
};
var firstTab = new TabItem
{
Header = new TextBlock {Text = "First Tab"},
Content = new TextBlock {Text = "First Tab Content"}
};
var secondTab = new TabItem
{
Header = new TextBlock {Text = "Second Tab"},
Content = new TextBlock {Text = "Second Tab Content"}
};
tabControl.AddTab(firstTab);
tabControl.AddTab(secondTab);
Chart.AddControl(tabControl);
}
}
import clr
clr.AddReference("cAlgo.API")
from cAlgo.API import *
class Test():
def get_text_block(self, text):
textBlock = TextBlock()
textBlock.Text = text
return textBlock
def initialize(self):
tabControl = TabControl()
tabControl.HorizontalAlignment = HorizontalAlignment.Center
tabControl.VerticalAlignment = VerticalAlignment.Center
firstTab = TabItem()
firstTab.Header = self.get_text_block("First Tab")
firstTab.Content = self.get_text_block("First Tab Content")
secondTab = TabItem()
secondTab.Header = self.get_text_block("Second Tab")
secondTab.Content = self.get_text_block("Second Tab Content")
tabControl.AddTab(firstTab)
tabControl.AddTab(secondTab)
api.Chart.AddControl(tabControl)
{
"AccessRights": "None"
}
Constructors
| Name | Description |
|---|---|
| TabControlDesktopCLICloud | Initializes a new instance of the TabControl class. |
Methods
| Name | Description |
|---|---|
AddTabDesktopCLICloudvoid | Adds a new tab. |
RemoveTabDesktopCLICloudbool | Removes an existing tab. |
Properties
| Name | Description |
|---|---|
SelectedTabDesktopCLICloudTabItem | Gets or sets the SelectedTab. |
TabStripPlacementDesktopCLICloudDock | Gets or sets the TabStripPlacement (Default: Top). |
TabsDesktopCLICloudIReadonlyList<TabItem> | Get tabs. |
Events
| Name | Description |
|---|---|
SelectedTabChangedDesktopCLICloudAction<TabControlSelectedTabChangedEventArgs> | Occurs when the selected tab is changed. |
Inherited members
From Control: ForegroundColor, BackgroundColor, Padding, VerticalContentAlignment, HorizontalContentAlignment, FontWeight, FontStyle, FontFamily, FontSize
From ControlBase: ResetProperty, UniqueId, Style, Left, Top, Right, Bottom, Width, Height, MinWidth, MinHeight, MaxWidth, MaxHeight, IsEnabled, IsVisible, Opacity, Margin, VerticalAlignment, HorizontalAlignment, Dock, IsHitTestVisible