This may be a C# question rather than an NT8 question. The indicator adds custom buttons to NT's main navigation menu. I would like to have the option to collapse multiple buttons into one drop menu. By using Controls.Menu and Controls.MenuItem, a drop-down menu was successfully created. https://i.imgur.com/Sqf2CNn.png
The problem is that it looks bad. To make it look good, copying NT's menu style will make the custom button uniform with the rest of NT's UI. https://i.imgur.com/P1FpTBK.png
The current solution is to grab one of the menus then grab its style and set my custom menu to it. I tried setting itemHelp to style but that just crashes the indicator.
List<Object> menuObjects = chartWindow.MainMenu.ToList(); System.Windows.Controls.Menu menuNT = (System.Windows.Controls.Menu) menuObjects[2]; //this grabs the Chart Style menu Style style = menuNT.Style; menu = new System.Windows.Controls.Menu(); menu.Style = style; System.Windows.Controls.MenuItem itemHelp = new System.Windows.Controls.MenuItem(); itemHelp.Header = "Buttons"; menu.ItemContainerStyle = menuNT.ItemContainerStyle;
Edit: Turns out there's no need to create and add a button direclty, just make and add a MenuItem and suscibe an event listner on it.
One more problem, clicking a button in the drop-down menu only works if the button is clicked not space around the button. Again, this may be more of a C# question. The problem is that every example I find is on Windows.Forms NOT Windows.Controls.
Thanks
Comment