Views
- 2 minutes to read
DXTabControl's layout, style and behavior settings are defined by view objects. Views are represented by the TabControlViewBase descendant classes. To apply a view to the tab control, create the appropriate view object and assign it to the DXTabControl.View property. The DXTabControl supports two types of view: MultiLine and Scroll.
#MultiLine View
In this view, if the number of tab headers is too large to entirely fit on a single line, the headers are arranged in multiple lines. As a result, all tab headers are displayed on the screen. This type of view is represented by the TabControlMultiLineView object.
By default, the line with the selected header is moved to become the first in the Header Panel, as shown below.
To prevent the lines of tab headers from being moved, use the TabControlMultiLineView.FixedHeaders property. If this property is set to true, each tab header holds its initial position, unless the number of headers or the Header Panel is resized.
#Scroll View
In this view, tab headers are displayed one after another in a single line. If the number of tab headers is too big to entirely fit on the Header Panel, DXTabControl displays scroll buttons. These buttons allow end-users to scroll through tab items. This type of view is represented by the TabControlScrollView object.
Scroll buttons can be automatically hidden when all the headers are visible and scrolling is not required. Use the TabControlScrollView.AutoHideScrollButtons property to enable this behavior. You can also specify the way the scroll buttons are shown. To do this, use the TabControlScrollView.ScrollButtonsShowMode property.
To scroll the Header Panel in code, use the TabControlScrollView.ScrollNext and TabControlScrollView.ScrollPrev methods. The panel can also be scrolled to make the first, the last, or the selected tab header visible. To do this, use the TabControlScrollView.ScrollFirst, TabControlScrollView.ScrollLast and TabControlScrollView.ScrollToSelectedTabItem methods respectively.
To obtain whether scrolling is available, use the TabControlScrollView.CanScroll, TabControlScrollView.CanScrollNext, TabControlScrollView.CanScrollPrev and TabControlScrollView.CanScrollToSelectedTabItem properties.
Tab headers can be oriented horizontally or vertically. This is specified by the TabControlScrollView.HeaderOrientation property. If this property is set to DefaultBoolean.Default, the header orientation is specified by the location of the Header Panel. If it is located on the left or the right side of the tab item, the headers are oriented vertically. Otherwise, headers are oriented horizontally.
Use the TabControlScrollView.HeaderAutoFill property to specify whether or not to stretch the tab headers to completely fill the Header Panel.