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.
    Hello All, Moving forward this will be maintained in the help guide reference samples and no longer maintained on the forum. Creating Chart WPF (UI) Modifications from an Indicator - https://ninjatrader.com/support/help...ui)-modifi.htm (https://ninjatrader.com/support/helpGuides/nt8/creating-chart-wpf-(ui)-modifi.htm) I've
    Chelsea B.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by TraderG23, 12-08-2023, 07:56 AM
    9 responses
    382 views
    1 like
    Last Post Gavini
    by Gavini
     
    Started by oviejo, Today, 12:28 AM
    0 responses
    1 view
    0 likes
    Last Post oviejo
    by oviejo
     
    Started by pechtri, 06-22-2023, 02:31 AM
    10 responses
    125 views
    0 likes
    Last Post Leeroy_Jenkins  
    Started by judysamnt7, 03-13-2023, 09:11 AM
    4 responses
    59 views
    0 likes
    Last Post DynamicTest  
    Started by ScottWalsh, Yesterday, 06:52 PM
    4 responses
    36 views
    0 likes
    Last Post ScottWalsh  
    Working...
    X