ContextMenu items are not displayed on small screen resolution

Ribbon for WPF Forum

Posted 7 years ago by Andras Eles
Version: 12.2.0570
Avatar

I created a sample WPF application that uses the MS ContextMenu with lots of items (~30). The MainWindow.xaml starts like this:

<Window x:Class="ContextMenuDemo.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="MainWindow"
        Width="525"
        Height="350">
  <Grid>
    <Label>
      Right Click Here!
      <Label.ContextMenu>
        <ContextMenu>
          <Button Content="Item10" />
          <Button Content="Item11" />
          <Button Content="Item12" />
          <Button Content="Item13" />
          <Button Content="Item14" />
          <Separator />

When I run the application on a monitor with 800x600 screen resolution the context menu - since there is not enough UI realestate to display the full list of items - shows little scroll arrows at the bottom and/or the top to allow navigating to invisible items.

Then I modified the application and changed Window to RibbonWindow, ContextMenu to Actipro ContextMenu and so on. I have also followed the Actipro documentation and added a Menu as the only direct child of the ContextMenu. The ContextMenu items are children of this Menu. Now the MainWindow.xaml starts like this:

<ribbon:RibbonWindow x:Class="ActiproDemo.MainWindow"
                     xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                     xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                     xmlns:ribbon="http://schemas.actiprosoftware.com/winfx/xaml/ribbon"
                     Width="525"
                     Height="350"
                     ApplicationName="Actipro Demo">
  <Grid>
    <Label>
      Right Click Here!
      <Label.ContextMenu>
        <ribbon:ContextMenu>
          <ribbon:Menu>
            <ribbon:Button Label="Item10" />
            <ribbon:Button Label="Item11" />
            <ribbon:Button Label="Item12" />
            <ribbon:Button Label="Item13" />
            <ribbon:Button Label="Item14" />
            <ribbon:Separator />
            <ribbon:Button Label="Item20" />

 When I run the application on the same 800x600 screen resolution monitor:

  1. Not all the items are visible (Same as MS behavior)
  2. There are no scroll arrows at the bottom and/or the top of the menu to allow navigation to invisible items (Not same as MS behavior)

Do you have any recommendation how to get the scroll arrows working with the Actipro ContextMenu?

Comments (2)

Posted 7 years ago by Adam Davis
Avatar
 <ribbon:ContextMenu>
          <ribbon:Menu>
            <!--<ScrollViewer>-->
              <ribbon:Button Label="Item10" />
              <ribbon:Button Label="Item11" />
              <ribbon:Button Label="Item12" />
              <ribbon:Button Label="Item13" />
              <ribbon:Button Label="Item14" />
              <ribbon:Separator />
              <ribbon:Button Label="Item20" />
            <!--</ScrollViewer>-->
          </ribbon:menu>
</ribbon:ContextMenu>

 Try inserting a your menu items inside a Scrollviewer.

Posted 7 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hi Andras,

I just did a test and loaded up a ribbon:ContextMenu with a lot of items (basically copied your original post's ribbon:ContextMenu code and added items) and I saw the scroll arrows fine. 

In the second post, Adam mentioned inserting a ScrollViewer.  You don't want to do that, and the scroll buttons should auto show as appropriate without it as it did in my test.

If you still think there is a problem, please make a new simple sample project that shows the issue and send it over in an email that references this post.  Rename the .zip file extension so it doesn't get spam blocked.  Thanks!


Actipro Software Support

The latest build of this product (v2019.1 build 0683) was released 1 month ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.