×

Sign up and get MultiCharts free

Use its powerful simulation mode with data included out of the box. Just fill out the form and start honing your trading skills with a few clicks.

Changes - MultiCharts
Open main menu

Changes

4.7.2 Chart ToolBar

1,680 bytes added, 15:34, 3 May 2013
Created page with "The studies can activate and access the toolbar for the chart. Such a toolbar can contain custom controls. Thus it is possible to let the user set the necessary values, colors..."
The studies can activate and access the toolbar for the chart. Such a toolbar can contain custom controls. Thus it is possible to let the user set the necessary values, colors, styles, etc., for the data shown by an indicator in a fast and convenient manner. Access to the toolbar is performed via the '''ChartToolBar''' property that is returned by the '''ICustomToolBar''' interface. This interface contains methods for accessing the toolbar and the property for manipulating visibility of this toolbar. Access to the toolbar is performed by calling one of the following methods:

# {{color|blue|void AccessToolBar(ToolBarAction action);}}
# {{color|blue|void AccessToolBarAsync(ToolBarAction action);}}


The difference between these two methods is the delegate of public delegate {{color|blue|void ToolBarAction(ToolStrip tb)}} type will be executed synchronously when {{color|blue|void AccessToolBar(ToolBarAction action);}} and asynchronously when {{color|blue|void AccessToolBarAsync(ToolBarAction action)}} is used.

The reason for using a delegate instead of calling the toolbar directly is simple: the study is calculated in its thread while chart toolbar as well chart controls are working in the main thread (UI).

The delegate accepts a single argument of '''System.Windows.Forms.ToolStrip''', the type that is familiar to those who have dealt with toolbar creation for WinForms windows. More information about this type and its methods can be found on msdn.

<div style="background-color: #E3FBE5;">NOTE:A pre-built indicator '''_Chart_ToolBar_Example_''' and a signal '''_ChartToolBar_Trading_''' may be used as examples. </div>
[[Category:.NET Programming Giude]]