Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

Style for SubMenuItem

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Style for SubMenuItem

    Hi there,

    I need a menu similar to NT's Chart Trader menu in my Add-On.
    Seems to work - except the missing headers in the sub menu items. (see attached screenshot).
    I think I have to use a different style for the sub menu items and tried many menu item styles of NT's resources but nothing found so far.

    Here's my current code:

    Menu myMenu = new Menu();
    myMenu.Style = Application.Current.TryFindResource("SystemMenuSty le") as Style;
    MainMenu.Add(myMenu);

    MenuItemChartTrader = new NTMenuItem()
    {
    Foreground = Brushes.Black,
    Height = 20,
    Icon = Icons.ChartTraderOpen,
    Style = Application.Current.TryFindResource("MainMenuItem" ) as Style,
    VerticalAlignment = VerticalAlignment.Center,
    VerticalContentAlignment = VerticalAlignment.Center,
    ToolTip = "Chart Trader",
    Width = 25
    };
    myMenu.Items.Add(MenuItemChartTrader);

    MenuItemChartTrader_Closed = new NTMenuItem()
    {
    Foreground = Brushes.Black,
    Header = "Closed",
    Height = 20,
    Icon = Icons.ChartTraderClosed,
    Style = Application.Current.TryFindResource("MainMenuItem" ) as Style,
    VerticalAlignment = VerticalAlignment.Center,
    VerticalContentAlignment = VerticalAlignment.Center,
    Width = 22
    };
    MenuItemChartTrader.Items.Add(MenuItemChartTrader_ Closed);

    Thanks in advance!
    Attached Files

    #2
    Hello ruppschtaler,

    Try using InstrumentMenuItem as the resource name.

    Below is a link to an example called ChartToolBarCustomMenuExample_NT8 that uses this.
    https://ninjatrader.com/support/foru...327#post499327
    Chelsea B.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by SuneSorgenfrei, Today, 04:47 AM
    1 response
    6 views
    0 likes
    Last Post NinjaTrader_ChrisSch  
    Started by lju45, Today, 04:54 AM
    0 responses
    6 views
    0 likes
    Last Post lju45
    by lju45
     
    Started by lakman184, Today, 03:09 AM
    4 responses
    14 views
    0 likes
    Last Post NinjaTrader_Jason  
    Started by romintrio, Today, 02:16 AM
    1 response
    4 views
    0 likes
    Last Post NinjaTrader_Jason  
    Started by SCC74, Today, 01:32 AM
    1 response
    10 views
    0 likes
    Last Post NinjaTrader_Jason  
    Working...
    X