• 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 Sulfred, Today, 06:07 AM
    2 responses
    4 views
    0 likes
    Last Post NinjaTrader_PaulH  
    Started by tff2011, Today, 06:43 AM
    1 response
    7 views
    0 likes
    Last Post NinjaTrader_Kate  
    Started by daigo1, Yesterday, 04:41 PM
    1 response
    28 views
    0 likes
    Last Post NinjaTrader_Jim  
    Started by concept, Yesterday, 04:22 PM
    1 response
    21 views
    0 likes
    Last Post NinjaTrader_ChristopherS  
    Started by Erwin Beckers, 08-06-2019, 11:54 AM
    3 responses
    44 views
    0 likes
    Last Post NinjaTrader_Kate  
    Working...
    X