I'd like to add some button on the ToolStripButton bar to open and close order.
I use the same code in a indicator and I can see the new button in bar.
private void InitializeControls()
{
try
{
System.Windows.Forms.Control[] controls = ChartControl.Controls.Find("tsrTool", false);
if (controls.Length > 0)
{
btnShort = new System.Windows.Forms.ToolStripButton("btnShort");
btnShort.ForeColor = Color.Black;
btnShort.AutoSize = true;
btnShort.BackColor = Color.DarkGray;
btnShort.Text = "Short";
strip = (System.Windows.Forms.ToolStrip)controls[0];
strip.Items.Add(btnShort);
btnShort.Click += btnShort_Click;
}
}
catch (Exception ex)
{
Print(ex.ToString());
}
}
Best Regards

Comment