1

I'm trying to add a scroll bar (ScrollViewer) to my Label.ContextMenu

However it doesn't accept it. I have looked all over the WPF sites and I cannot find a viable solution. I have tried adding in stack panels and the works and even though it won't complain about the syntax it will not display the 2nd tier items. It won't even accept the max height on the control so I can limit the items shown to let's say 10.

Note that the context menu is populated via a data set (no issue there).

Can anyone please provide a viable solution?

< Label.Contextmenu > 
< contentMenu style='{xxxx}' {controls.my control that gets added to the menu that has the items in it} </contextMenu > 
</label.contextmenu >
Grant
  • 33
  • 8
  • The opening tag `< Label.Contextmenu />` has a backslash, making it a null-content tag. Could that be your problem? – StoneGiant Nov 09 '18 at 18:22
  • No its definately not that. the code above was just a minor example of what i was using just to give context to what i was asking for. Sorry for the typo. I'll update it. – Grant Nov 12 '18 at 10:37
  • So I basically have what I need to do. I just have no idea how to do it. I need to set the MaxHeight and the CanContentScroll to the SubMenuScrollViewer. I just dont know how to do that. Thats the only part that i need to add and it should work (messed around with Snoop to see what and where I need to set). Some assistance would be amazing thank you. – Grant Nov 12 '18 at 13:03
  • I recommend you post your actual code, because even your updated example has typos in it. – StoneGiant Nov 12 '18 at 15:24
  • Also, the answer to [this question](https://stackoverflow.com/questions/736153/enabling-scrollbar-in-wpf) might be helpful to you. I don't know. – StoneGiant Nov 12 '18 at 15:28
  • Unfortunately that doesnt work. basically what that does is that the ContentMenu appears but the 2nd tier wont show. When i try add it around the menu items it does the same thing or it applies it to the granular level. sorry I cant post the original code. I just need a point in the right direction,I have even gone down the route of changing the control template but to no success. – Grant Nov 12 '18 at 15:49

0 Answers0