Articles in this section
Category / Section

How to control visibility of separators in button panel of WPF Ribbon control?

1 min read

You can change the visibility of the separators in the ButtonPanel by using the SeparatorVisibility property in WPF Ribbon control. The default value of the SeparatorVisibility is Visible. The remaining possible values are HiddenVisible, and Collapsed.

XAML

<Syncfusion:Ribbon Name="ribbon" VerticalAlignment="Top" >
     <Syncfusion:RibbonTab   Caption="Home" IsChecked="False" >
          <Syncfusion:RibbonBar  IsLargeButtonPanel="False" Header="Font" >
               <Syncfusion:ButtonPanel Name="buttonPanel" SeparatorVisibility="Visible">
                    <Syncfusion:RibbonComboBox  IsEditable="True"  Width="110"  />
                    <Syncfusion:RibbonComboBox  IsEditable="True" Width="40" />
               </Syncfusion:ButtonPanel>
               <Syncfusion:ButtonPanel SeparatorVisibility="Collapsed" Height="24">
                    <Syncfusion:RibbonButton  Padding="2" Height="24" Width="24"  SizeForm="ExtraSmall" SmallIcon="/Resources/GrowFont16.png" />
                    <Syncfusion:RibbonButton Padding="2" Height="24" Width="24"   SizeForm="ExtraSmall" SmallIcon="/Resources/ShrinkFont16.png" />
               </Syncfusion:ButtonPanel>
               <Syncfusion:ButtonPanel SeparatorVisibility="Collapsed"  Height="24">
                    <Syncfusion:RibbonButton Padding="2" Height="24" Width="24"  SizeForm="ExtraSmall" SmallIcon="/Resources/ClearFormatting16.png"/>
               </Syncfusion:ButtonPanel>
               <Syncfusion:ButtonPanel SeparatorVisibility="Collapsed" Height="24">
                    <Syncfusion:RibbonButton Padding="2" Height="24" Width="24"  SizeForm="ExtraSmall" IsToggle="True"   SmallIcon="/Resources/Bold16.png"/>
                    <Syncfusion:RibbonButton Padding="2" Height="24" Width="24"  SizeForm="ExtraSmall" IsToggle="True"  SmallIcon="/Resources/Italic16.png"/>
                    <Syncfusion:SplitButton Padding="2" Height="24" Width="37"   SizeForm="ExtraSmall"   SmallIcon="/Resources/Underline16.png"/>
                    <Syncfusion:RibbonButton Padding="2" Height="24" Width="24"  SizeForm="ExtraSmall"   SmallIcon="/Resources/Strikethrough16.png"/>
                    <Syncfusion:RibbonButton Padding="2" Height="24" Width="24"  SizeForm="ExtraSmall"   SmallIcon="/Resources/Subscript16.png"/>
                    <Syncfusion:RibbonButton Padding="2" Height="24" Width="24"  SizeForm="ExtraSmall"   SmallIcon="/Resources/SuperScript16.png"/>
               </Syncfusion:ButtonPanel>
               <Syncfusion:ButtonPanel SeparatorVisibility="Collapsed"  Height="24">
                    <Syncfusion:SplitButton Padding="2" Height="24" Width="37" SizeForm="ExtraSmall" SmallIcon="/Resources/TextHighlightColor16.png"/>
                    <Syncfusion:SplitButton Padding="2" Height="24" Width="37" SizeForm="ExtraSmall" SmallIcon="/Resources/FontColor16.png"/>
               </Syncfusion:ButtonPanel>
          </Syncfusion:RibbonBar>
     </Syncfusion:RibbonTab>
     <Syncfusion:RibbonTab   Caption="Insert"/>
</Syncfusion:Ribbon>

 

C#

buttonPanel.SeparatorVisibility = Visibility.Visible;

 

The following screenshot displays the Button Panel with Separator Collapsed and Visible.

The button panel with separator collapsed and visible

View sample in GitHub.


Conclusion

I hope you enjoyed learning about how to control visibility of separators in button panel of WPF Ribbon control.

 You can refer to our WPF Ribbon feature tour  page to know about its other groundbreaking feature representations. You can also explore  documentation to understand how to create and manipulate data.

For current customers, you can check out our components from the License and Downloads page. If you are new to Syncfusion, you can try our 30-day free trial to check out our other controls.

If you have any queries or require clarifications, please let us know in the comments section below. You can also contact us through our support forumsDirect-Trac, or feedback portal. We are always happy to assist you!

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments (0)
Please sign in to leave a comment
Access denied
Access denied