Bethesda, Maryland
Experience: Intermediate
Platform: NinjaTrader
Trading: stocks
Posts: 5 since May 2011
Thanks Given: 36
Thanks Received: 2
|
My first post to Big Mike's... I'm trying to add a 2nd toolbar to the default NT toolbar on a chart. I've managed to find code that enables me to add buttons on the same default NT toolbar. However, I would like to add a new toolbar just below the default one. I'm sure this is something simple, but I'm just not there yet.
Help.
-fosch
Here is the code that I used to add my buttons to the first toolbar... (perhaps it's just a tweak, or a couple lines of code to get my 2nd toolbar?)
#region Variables
private System.Windows.Forms.ToolStrip strip = null;
private System.Windows.Forms.Control[] controls = null;
private System.Windows.Forms.ToolStripButton btnOrderType = null;
protectedoverridevoid OnStartUp()
{
System.Windows.Forms.Control[] controls = ChartControl.Controls.Find("tsrTool", false);
if (controls.Length > 0)
{
ToolStripButton btnTemp = new System.Windows.Forms.ToolStripButton("temp");
boldFont = new Font("Arial", 8,FontStyle.Bold);
regularFont = new Font("Arial", 8);
btnTemp = null;
strip = (System.Windows.Forms.ToolStrip)controls[0];
//BUTTON #1 -- Order Type Button (STPLMT, LIMIT) -------------------
btnOrderType = new System.Windows.Forms.ToolStripButton("btnOrderType");
btnOrderType.Font =regularFont;
btnOrderType.ForeColor = Color.Black;
btnOrderType.BackColor=Color.Orange;
btnOrderType.Text = "SL";
strip.Items.Add(btnOrderType);
btnOrderType.Click += btnOrderType_Click;
//--------------------------------------------------------------------
buttonsloaded=true;
}
}
protectedoverridevoid OnTermination() {
if (buttonsloaded==true)
{
strip.Items.Remove(btnOrderType); //Button #1
} }
|