• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

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 dltharpe, Today, 09:17 AM
    0 responses
    2 views
    0 likes
    Last Post dltharpe  
    Started by HiddenPhilosopher, Today, 06:45 AM
    0 responses
    6 views
    0 likes
    Last Post HiddenPhilosopher  
    Started by PG7940, Today, 04:26 AM
    0 responses
    8 views
    0 likes
    Last Post PG7940
    by PG7940
     
    Started by marcus2300, Today, 02:25 AM
    0 responses
    2 views
    0 likes
    Last Post marcus2300  
    Started by drpapp, 01-24-2019, 06:57 AM
    5 responses
    69 views
    0 likes
    Last Post pjsmith
    by pjsmith
     
    Working...
    X