Skip to content

TabControl constructor

constructor · TabControl · cAlgo.API Since 5.2

DesktopCLICloud

Initializes a new instance of the TabControl class.

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 TabControl()
TabControl()

Examples

var tabControl = new TabControl { Width = 300, Height = 200 };
tabControl.AddTab(new TabItem { Header = new TextBlock { Text = "Positions" }, Content = new TextBlock { Text = "Open positions: " + Positions.Count } });
tabControl.AddTab(new TabItem { Header = new TextBlock { Text = "Orders" }, Content = new TextBlock { Text = "Pending orders: " + PendingOrders.Count } });
Chart.AddControl(tabControl);
tabControl = TabControl()
tabControl.Width = 300
tabControl.Height = 200
for title, text in [("Positions", f"Open positions: {api.Positions.Count}"), ("Orders", f"Pending orders: {api.PendingOrders.Count}")]:
    header = TextBlock()
    header.Text = title
    content = TextBlock()
    content.Text = text
    tab = TabItem()
    tab.Header = header
    tab.Content = content
    tabControl.AddTab(tab)
api.Chart.AddControl(tabControl)