NexusFi: Find Your Edge


Home Menu

 





New Drop Down in Toolbar


Discussion in NinjaTrader

Updated
      Top Posters
    1. looks_one timmyb with 17 posts (9 thanks)
    2. looks_two bukkan with 6 posts (2 thanks)
    3. looks_3 Big Mike with 2 posts (0 thanks)
    4. looks_4 gomi with 1 posts (0 thanks)
    1. trending_up 9,156 views
    2. thumb_up 11 thanks given
    3. group 6 followers
    1. forum 27 posts
    2. attach_file 2 attachments




 
Search this Thread

New Drop Down in Toolbar

  #1 (permalink)
 timmyb 
duluth,mn
 
Experience: Advanced
Platform: ninja,thinkorswim
Broker: Amp-Zenfire
Trading: ES,Options
Posts: 654 since Feb 2010
Thanks Given: 81
Thanks Received: 1,361

Ok this is driving me insane I have a drop down i got added to the toolbar but I cant seem to get a event arg to work right.

public void Picked(object sender, EventArgs e)
{





if (mycomboBox1.MouseDown == true)



{
MessageBox.Show("holy cow it works");
}

}


this was my last attemmpt. what i wanted was for it to do "something" when I click the drop down and choose a setting. I tried .dropdown .droppeddown. I got it to finally work but it was only working onbarupdate and then firing everytime there was a update.

and yes i do have it in the form setup elsewhere. i just cant seem to get it to acknowledge it being clicked etc



Heeellllllppp



thanks

tim

Visit my NexusFi Trade Journal Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
NexusFi Journal Challenge - April 2024
Feedback and Announcements
Are there any eval firms that allow you to sink to your …
Traders Hideout
Deepmoney LLM
Elite Quantitative GenAI/LLM
My NT8 Volume Profile Split by Asian/Euro/Open
NinjaTrader
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Get funded firms 2023/2024 - Any recommendations or word …
59 thanks
Funded Trader platforms
36 thanks
NexusFi site changelog and issues/problem reporting
25 thanks
GFIs1 1 DAX trade per day journal
19 thanks
The Program
18 thanks
  #3 (permalink)
 bukkan 
Calcutta, India
 
Experience: Intermediate
Platform: ArthaChitra
Posts: 278 since Jun 2009
Thanks Given: 161
Thanks Received: 271


what event you triggered. try the selectedindexchanged event

Reply With Quote
Thanked by:
  #4 (permalink)
 timmyb 
duluth,mn
 
Experience: Advanced
Platform: ninja,thinkorswim
Broker: Amp-Zenfire
Trading: ES,Options
Posts: 654 since Feb 2010
Thanks Given: 81
Thanks Received: 1,361

Here is the firing part


 
Code
#region Toolbar Combo Box Code, remember to add dispose method and add to private ToolStripComboBox mycomboBox1;
            
            mycomboBox1 = new ToolStripComboBox ();
            mycomboBox1.Items.AddRange(new object[] 
            {
            "Min,Max,Delta",
            "Bannanas",
            "Cucumbers"
            });
            mycomboBox1.Name = "B4";
            mycomboBox1.Size = new System.Drawing.Size(116, 21);
            mycomboBox1.SelectedIndexChanged += new EventHandler (Picked);
            
            #endregion
then here is next code

 
Code
public void Picked(object sender, EventArgs e)
        {
        
        
            
            
            
            if (mycomboBox1.Selected)
            {
            MessageBox.Show("holy cow it works");    
            }
        
        }

thanks again bukken, i was hoping you would be the one to reply basically I am trying to add drop downs for the new ladder version I am working on on the toolbar. So basically If "bannanas" is selected do this etc. To replace some of my hotkey functionality.

The above works each time i click the combo box choices. Now i think I have to convert the text to string to add which one is selected. I read something about using a value like 0,1,2. Anyway I am knew to this windows form thing. First thing I ever did was 3 days ago so I am glad you are bearing with.

I tried this but it compiles and doesnt work.

 
Code
public void Picked(object sender, EventArgs e)
        {
        
        
            string SelectedString = mycomboBox1.Text;
            
            
            if (mycomboBox1.Selected && SelectedString == "bannanas")
            {
            MessageBox.Show("holy cow it works");    
            }
        
        }
thanks again for the guidance. I think i am grasping things pretty good for a few days but i know some things you must look at and go

But then I am a car mechanic and when I rebuild and engine and port heads etc you probably would be stadning there going "valve clearance?"

Visit my NexusFi Trade Journal Started this thread Reply With Quote
Thanked by:
  #5 (permalink)
 timmyb 
duluth,mn
 
Experience: Advanced
Platform: ninja,thinkorswim
Broker: Amp-Zenfire
Trading: ES,Options
Posts: 654 since Feb 2010
Thanks Given: 81
Thanks Received: 1,361

Wooohooo I got it

 
Code
public void Picked(object sender, EventArgs e)
        {
        
        
            string SelectedString = mycomboBox1.Text;
            
            
            if (mycomboBox1.SelectedItem == "Bannanas")
            
            {
            
                //if (SelectedString == "bannanas")    
                //{
                MessageBox.Show("holy cow it works");
            //    }
            
            }
        
        }
Figured i would post it here for those who may find this

Visit my NexusFi Trade Journal Started this thread Reply With Quote
Thanked by:
  #6 (permalink)
 timmyb 
duluth,mn
 
Experience: Advanced
Platform: ninja,thinkorswim
Broker: Amp-Zenfire
Trading: ES,Options
Posts: 654 since Feb 2010
Thanks Given: 81
Thanks Received: 1,361

One other question I have is that if I tie this to a bool, when users save a template will it be set correctly on load??

basically I am adding drop downs to top of toolbar to adjust gomladder functions on the fly, I notice when i press F5 the drop down reloads to blank state. I will throw it in my code and see how ti turns out

Visit my NexusFi Trade Journal Started this thread Reply With Quote
  #7 (permalink)
 bukkan 
Calcutta, India
 
Experience: Intermediate
Platform: ArthaChitra
Posts: 278 since Jun 2009
Thanks Given: 161
Thanks Received: 271

you may also try

if (mycbox.SelectedIndex == 0)
{
//do something
}
else if (mycbox.SelectedIndex == 1)
{
//do something
}

Reply With Quote
Thanked by:
  #8 (permalink)
 timmyb 
duluth,mn
 
Experience: Advanced
Platform: ninja,thinkorswim
Broker: Amp-Zenfire
Trading: ES,Options
Posts: 654 since Feb 2010
Thanks Given: 81
Thanks Received: 1,361


bukkan View Post
you may also try

if (mycbox.SelectedIndex == 0)
{
//do something
}
else if (mycbox.SelectedIndex == 1)
{
//do something
}

is 0 always the first text in the drop down?? and so on and so forth?? or do you need to set that.??

Visit my NexusFi Trade Journal Started this thread Reply With Quote
  #9 (permalink)
 bukkan 
Calcutta, India
 
Experience: Intermediate
Platform: ArthaChitra
Posts: 278 since Jun 2009
Thanks Given: 161
Thanks Received: 271


timmyb View Post
is 0 always the first text in the drop down?? and so on and so forth?? or do you need to set that.??

yes 0 is the first item, and is a zero base index.

Reply With Quote
  #10 (permalink)
 timmyb 
duluth,mn
 
Experience: Advanced
Platform: ninja,thinkorswim
Broker: Amp-Zenfire
Trading: ES,Options
Posts: 654 since Feb 2010
Thanks Given: 81
Thanks Received: 1,361


Still fiddling, waiting for Santa to come. Curious if you guys know how to add a drop down box with checkboxes. I cant seem to find it as a choice in toolbar. I see natively ninja has it. Merry Christmas guys

Visit my NexusFi Trade Journal Started this thread Reply With Quote




Last Updated on July 9, 2011


© 2024 NexusFi™, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
All information is for educational use only and is not investment advice. There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Privacy Policy - Downloads - Top
no new posts