Skip to content

TabControl

Summary

Represents the Tab control.

Signature

1
public class TabControl : Control

Namespace

cAlgo.API

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
 using cAlgo.API;
 namespace cAlgo.Robots;
 [Robot(AccessRights = AccessRights.None)]
 public 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);
     }
 }
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
 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)

See Also

Methods

AddTab

Summary

Adds a new tab.

Signature

1
public void AddTab(TabItem tab)

Parameters

Name Type Description
tab TabItem Tab

Return Value

void

RemoveTab

Summary

Removes an existing tab.

Signature

1
public bool RemoveTab(TabItem tab)

Parameters

Name Type Description
tab TabItem Tab

Return Value

bool

Properties

TabStripPlacement

Summary

Gets or sets the TabStripPlacement (Default: Top).

Signature

1
public Dock TabStripPlacement {get; set;}

Return Value

Dock

SelectedTab

Summary

Gets or sets the SelectedTab.

Signature

1
public TabItem SelectedTab {get; set;}

Return Value

TabItem

Tabs

Summary

Get tabs.

Signature

1
public IReadonlyList<TabItem> Tabs {get;}

Return Value

IReadonlyList

Events

SelectedTabChanged

Summary

Occurs when the selected tab is changed.

Signature

1
public event Action<TabControlSelectedTabChangedEventArgs> SelectedTabChanged;