Ribbon Group to stay same size as others fall to smaller

Ribbon for WPF Forum

Posted 4 years ago by Hamid Noorbakhsh
Version: 16.1.0631
Avatar

I am using Ribbon and have several Groups in one Tab. As one reduces the width, they fall to the smaller 'Variant' size. I would like all groups to do what they are doing, except one that needs to remain still the same size. How can I acheive this? The Group contains 3 items (Button/SplitButton). I also want to have Button stay same size and the other twothat are ina Ribbon StackPanel to get one notch smaller.

I hope I am making sense. Everything works great/commands, etc. I am just in need of the resizing help.

 

See code below - Want the group to NEVER change size - SplitButton NEVER change size, but the two other buttons to get smaller, but show.

 

<apribbon:Ribbon.Tabs>
   <apribbon:Tab KeyTipAccessText="H" Label="HOME">
      <apribbon:Group ImageSourceSmall="/AMTB;component/Resources/Icons/run_16.png" Label="Task">
         <apribbon:Group.Variants>
            <apribbon:GroupVariant Priority="1" Size="Large" />
         </apribbon:Group.Variants>
         <apribbon:SplitButton Command="tbcommands:TBCommandManager.RunTask">
            <apribbon:Menu>
               <apribbon:Button Command="tbcommands:TBCommandManager.RunTask" Label="Run All" />
               <apribbon:Button Command="tbcommands:TBCommandManager.RunSelected" />
               <apribbon:Button Command="tbcommands:TBCommandManager.RunFromHere" />
               <apribbon:Button Command="tbcommands:TBCommandManager.StepThrough" />
            </apribbon:Menu>
          </apribbon:SplitButton>
          <apribbon:Separator />
          <apribbon:Button Command="tbcommands:TBCommandManager.StepThrough" />
          <apribbon:Button Command="tbcommands:TBCommandManager.StopExecution" />
      </apribbon:Group>
.
.
.
and more code with Groups

Comments (2)

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

Hi Hamid,

You can set the Group's IsCollapsible property to false to prevent it from collapsing at all.

The two buttons after the separator would need to be in a ribbon:StackPanel.  That should keep them large and side-by-side by default but then move them to being on top of each other when space is needed.  The StackPanel.ItemVariantBehavior property governs which variants are applied within the stack panel and when.


Actipro Software Support

Posted 4 years ago by Hamid Noorbakhsh
Avatar

Worked great! Thank you, just did not look for the IsCollapsable. Once that was set, the rest was easy. I did use the StackPanel as suggested as it is EXACTLY what I wanted. Thanks again!

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.