Back to Devexpress

Scroll View

wpf-113876-controls-and-libraries-layout-management-tab-control-fundamentals-views-scroll-view.md

latest4.7 KB
Original Source

Scroll View

  • Jan 08, 2025
  • 2 minutes to read

In Scroll View (TabControlScrollView), the tab control arranges tab headers in a single line. If the number of headers exceeds the available space in the Header Panel, the tab control displays scroll buttons to navigate through tab headers.

Run Demo: Tab Control Views

Scroll Tab Headers

Scroll Buttons

Use the TabControlScrollView.ScrollButtonShowMode property to specify scroll button visibility.

The following table lists available modes:

ModeDescription
AlwaysScroll buttons are always visible.
NeverScroll buttons are hidden (even if tabs overflow).
AutoHideBothButtonsBoth scroll buttons appear or disappear together, based on necessity.
AutoHideEachButtonScroll buttons appear or disappear independently, based on necessity.

The following code snippet displays scroll buttons in a tab control based on necessity:

xaml
<dx:DXTabControl>
    <dx:DXTabControl.View>
        <dx:TabControlScrollView ScrollButtonShowMode="AutoHideBothButtons"/>
    </dx:DXTabControl.View>
    <dx:DXTabItem Header="Tab A"/>
    <dx:DXTabItem Header="Tab B"/>
    <dx:DXTabItem Header="Tab C"/>
</dx:DXTabControl>

Mouse Wheel

The AllowScrollOnMouseWheel property specifies whether users can scroll tab headers using the mouse wheel.

Scroll Animation

Set the AllowAnimation property to true to enable smooth scrolling animation.

xaml
<dx:DXTabControl>
    <dx:DXTabControl.View>
        <dx:TabControlScrollView AllowAnimation="True"/>
    </dx:DXTabControl.View>
</dx:DXTabControl>

Stretch Tab Headers

Enable the HeaderAutoFill option to stretch tab headers so that they fill the available space evenly within the header panel.

xaml
<dx:DXTabControl>
    <dx:DXTabControl.View>
        <dx:TabControlScrollView HeaderAutoFill="True"/>
    </dx:DXTabControl.View>
</dx:DXTabControl>

Tab Header Orientation

Use the HeaderOrientation property to specify the orientation of tab headers (horizontal or vertical):

xaml
<dx:DXTabControl>
    <dx:DXTabControl.View>
        <dx:TabControlScrollView HeaderOrientation="Vertical"/>
    </dx:DXTabControl.View>
</dx:DXTabControl>

NameDescription
ScrollNext()Scrolls the header panel forward by one tab.
ScrollPrev()Scrolls the header panel backward by one tab.
ScrollFirst()Scrolls the header panel to the first tab.
ScrollLast()Scrolls the header panel to the last tab.
ScrollToSelectedTabItemScrolls the header panel to display the specified tab.
CanScrollIndicates whether the header panel can scroll in any direction.
CanScrollNextIndicates whether the header panel can scroll forward to display additional tabs.
CanScrollPrevIndicates whether the header panel can scroll backward to display previously hidden tabs.
CanScrollToSelectedTabItemIndicates whether the header panel can scroll to display the specified tab.

Tip

Read the following help topic to learn more: Tab Control Views.

See Also

MultiLine View

Stretch View