New to Telerik UI for WinForms? Start a free 30-day trial

Hosts ordered TabPanel controls and synchronizes their selection with a page-view tab strip.

Definition

Namespace:Telerik.WinControls.UI

Assembly:Telerik.WinControls.UI.dll

Syntax:

C#
public class TabStripPanel : SplitPanel, IDropTarget, ISynchronizeInvoke, IWin32Window, IBindableComponent, IComponent, IDisposable, INotifyPropertyChanged, ISupportInitializeNotification, ISupportInitialize, IComponentTreeHandler, ILayoutHandler, IAnalyticsProvider

Inheritance: objectMarshalByRefObjectComponentControlScrollableControlRadControlSplitPanelTabStripPanel...

Derived Classes: DockTabStrip

Implements: IAnalyticsProviderIBindableComponentIComponentIComponentTreeHandlerIDisposableIDropTargetILayoutHandlerINotifyPropertyChangedISupportInitializeISupportInitializeNotificationISynchronizeInvokeIWin32Window...

Inherited Members SplitPanel.SetBoundsCore(int, int, int, int, BoundsSpecified)SplitPanel.OnControlAdded(ControlEventArgs)SplitPanel.OnControlTreeChanged(ControlTreeChangedEventArgs)SplitPanel.OnControlRemoved(ControlEventArgs)SplitPanel.WndProc(ref Message)SplitPanel.ScaleControl(SizeF, BoundsSpecified)SplitPanel.ElementTreeSplitPanel.EnableKeyMapSplitPanel.CommandBindingsSplitPanel.ThemeClassNameSplitPanel.ImageScalingSizeSplitPanel.IsDesignModeSplitPanel.BorderStyleSplitPanel.SizeInfoSplitPanel.CreateParamsSplitPanel.MinimumSizeSplitPanel.MaximumSizeSplitPanel.DefaultSizeSplitPanel.SplitContainerSplitPanel.SplitPanelElementSplitPanel.CollapsedSplitPanel.DefaultMarginSplitPanel.ControlTreeChangedRadControl.isResizing2RadControl.isDisposing2RadControl.invalidResizeRectRadControl.isAccessibilityRequestedRadControl.Construct()RadControl.CreateBehavior()RadControl.CreateRootElement()RadControl.InitializeRootElement(RootRadElement)RadControl.LoadElementTree()RadControl.LoadElementTree(Size)RadControl.SetBackColorThemeOverrides()RadControl.ResetBackColorThemeOverrides()RadControl.SetForeColorThemeOverrides()RadControl.ResetForeColorThemeOverrides()RadControl.OnKeyDown(KeyEventArgs)RadControl.OnKeyUp(KeyEventArgs)RadControl.OnPreviewKeyDown(PreviewKeyDownEventArgs)RadControl.OnKeyPress(KeyPressEventArgs)RadControl.OnClick(EventArgs)RadControl.OnDoubleClick(EventArgs)RadControl.OnMouseUp(MouseEventArgs)RadControl.OnMouseEnter(EventArgs)RadControl.OnMouseLeave(EventArgs)RadControl.OnMouseHover(EventArgs)RadControl.OnMouseWheel(MouseEventArgs)RadControl.OnGotFocus(EventArgs)RadControl.OnLostFocus(EventArgs)RadControl.OnCreateControl()RadControl.OnHandleDestroyed(EventArgs)RadControl.OnParentChanged(EventArgs)RadControl.OnVisibleChanged(EventArgs)RadControl.OnFontChanged(EventArgs)RadControl.OnForeColorChanged(EventArgs)RadControl.OnBackColorChanged(EventArgs)RadControl.OnEnabledChanged(EventArgs)RadControl.OnBindingContextChanged(EventArgs)RadControl.OnLocationChanged(EventArgs)RadControl.OnPaddingChanged(EventArgs)RadControl.OnRightToLeftChanged(EventArgs)RadControl.OnPaint(PaintEventArgs)RadControl.OnAutoSizeChanged(EventArgs)RadControl.OnInvalidated(RadElement)RadControl.OnLoad(Size)RadControl.OnCaptureLosing()RadControl.OnToolTipTextNeeded(object, ToolTipTextNeededEventArgs)RadControl.OnScreenTipNeeded(object, ScreenTipNeededEventArgs)RadControl.OnThemeNameChanged(ThemeNameChangedEventArgs)RadControl.ProcessMnemonic(char)RadControl.ProcessFocusRequested(RadElement)RadControl.ProcessCaptureChangeRequested(RadElement, bool)RadControl.ProcessAutoSizeChanged(bool)RadControl.GetInputElement()RadControl.BeginInit()RadControl.EndInit()RadControl.OnNotifyPropertyChanged(string)RadControl.OnNotifyPropertyChanged(PropertyChangedEventArgs)RadControl.GetPreferredSize(Size)RadControl.GetRootElementDesiredSize(int, int, int, int)RadControl.OnZoomGesture(ZoomGestureEventArgs)RadControl.OnRotateGesture(RotateGestureEventArgs)RadControl.OnPanGesture(PanGestureEventArgs)RadControl.OnTwoFingerTapGesture(GestureEventArgs)RadControl.OnPressAndTapGesture(PressAndTapGestureEventArgs)RadControl.OnGesture(GestureEventArgs)RadControl.ProcessGesture(Message)RadControl.EnableGesture(GestureType)RadControl.DisableGesture(GestureType)RadControl.Refresh()RadControl.SuspendUpdate()RadControl.ResumeUpdate()RadControl.ResumeUpdate(bool)RadControl.InvokeLayoutCallback(LayoutCallback)RadControl.RegisterHostedControl(RadHostItem)RadControl.UnregisterHostedControl(RadHostItem, bool)RadControl.ResolveStyleGroupForElement(StyleGroup, RadObject)RadControl.GetPlainText()RadControl.ShouldSerializeProperty(RadProperty)RadControl.ShouldSerializeProperty(RadProperty, RadObject)RadControl.ResetProperty(RadProperty, RadObject)RadControl.CanEditElementAtDesignTime(RadElement)RadControl.ProcessCodedUIMessage(ref IPCMessage)RadControl.FindPropertyInChildren(RadControl, IPCMessage)RadControl.PerformRadAutoScale(BoundsSpecified?)RadControl.GetMonitorDpiScaleFactor(Control)RadControl.SetRadAutoScale(bool)RadControl.EnableDpiScalingRadControl.EnableRadAutoScaleRadControl.EnableRadFormInitialDpiScalingRadControl.EnableImageDpiScalingRadControl.EnableSvgImagesRadControl.IsLoadedRadControl.UseCompatibleTextRenderingDefaultValueRadControl.BehaviorRadControl.RootElementRadControl.PaddingRadControl.ThemeNameRadControl.TextRadControl.EnableThemingRadControl.UseCompatibleTextRenderingRadControl.AutoSizeRadControl.FocusableRadControl.SiteRadControl.CausesValidationRadControl.IsInitializingRadControl.SmallImageListRadControl.SmallImageScalingSizeRadControl.IsDisplayedRadControl.FocusedElementRadControl.AllowShowFocusCuesRadControl.ShowItemToolTipsRadControl.BackColorRadControl.ForeColorRadControl.FontRadControl.ValidationCancelRadControl.EnableAnalyticsRadControl.AnalyticsNameRadControl.EnableRadAccessibilityObjectsRadControl.EnableCodedUITestsRadControl.EnableCodedUITestsDefaultValueRadControl.EnableUIAutomationRadControl.EnableUIAutomationDefaultValueRadControl.ElementInvalidatedRadControl.ToolTipTextNeededRadControl.ScreenTipNeededRadControl.ThemeNameChangedRadControl.InitializedRadControl.PropertyChangedRadControl.ZoomGestureRadControl.RotateGestureRadControl.PanGestureRadControl.TwoFingerTapGestureRadControl.PressAndTapGesture...

Constructors

Creates an empty tab strip with strip visibility enabled by default; actual visibility depends on whether panels are present.

C#
public TabStripPanel()

Fields

When true, suppresses automatic selection synchronization while child panels are added, reordered, removed, or handle creation initializes selection.

C#
public static bool DisableSelection

When true, prevents UpdateTabSelection(bool) from performing its explicit focus transfer into a panel; it does not suppress focus caused by showing a hidden panel.

C#
public static bool SuspendFocusChange

Properties

Gets the default alignment of the TabStripElement.

C#
protected virtual TabStripAlignment DefaultTabStripAlignment { get; }

Gets the default text orientation.

C#
protected virtual TabStripTextOrientation DefaultTabStripTextOrientation { get; }

Gets the point where the mouse was pressed and a drag operation has been instanciated.

C#
[Browsable(false)]
public Point DragStart { get; }

Gets whether the tab-strip panel contains any tab panels. This checks collection count, not each panel's Visible state.

C#
[Browsable(false)]
public bool HasVisibleTabPanels { get; }

Gets or sets the image list associated with this control. The control clears its reference when the image list is disposed.

C#
public override ImageList ImageList { get; set; }

Overrides: SplitPanel.ImageList

Gets or sets the selected panel index; -1 represents no selection. A change can be canceled through SelectedIndexChanging.

C#
[Browsable(false)]
public int SelectedIndex { get; set; }
Exceptions: ArgumentOutOfRangeException

The value is less than -1 after the control handle has been created.

Gets or sets the selected panel. If the stored index is negative while panels exist, the getter records index zero but returns null on that read; the next read returns the first panel.

C#
[Browsable(false)]
public TabPanel SelectedTab { get; set; }

Determines whether each tab item displays a close button for its corresponding panel.

C#
public bool ShowItemCloseButton { get; set; }

Determines whether each tab item displays a pin button for its corresponding panel.

C#
public bool ShowItemPinButton { get; set; }

Gets the content bounds remaining after the tab strip and its padding are accounted for; reading the property also updates strip visibility.

C#
[Browsable(false)]
public virtual Rectangle TabPanelBounds { get; }

Gets the insets between this control's display rectangle and the current tab-panel content bounds.

C#
protected Padding TabPanelPaddings { get; }

Gets the ordered collection of panels hosted by this tab strip.

C#
public TabPanelCollection TabPanels { get; }

Gets or sets the alignment of the tab used to switch among child panels.

C#
public TabStripAlignment TabStripAlignment { get; set; }

Gets the page-view strip element that renders and manages this panel's tab items.

C#
[Browsable(false)]
public RadPageViewStripElement TabStripElement { get; }

Gets or sets the text orientation of the tab used to switch among child panels.

C#
public TabStripTextOrientation TabStripTextOrientation { get; set; }

Determines whether the tab used to navigate among child panels is displayed.

C#
public bool TabStripVisible { get; set; }

Methods

Creates the tab-strip element, configures its layout, and connects its selection and item-change events.

C#
protected override void CreateChildItems(RadElement parent)
Parameters:parentRadElement

The root element that hosts the strip.

Overrides: SplitPanel.CreateChildItems(RadElement)

Creates the child-control collection that keeps tab panels and their strip items in sync.

C#
protected override Control.ControlCollection CreateControlsInstance()
Returns:

Control.ControlCollection

A collection that accepts TabPanel children and updates their tab items.

Overrides: Control.CreateControlsInstance()

Creates the strip item associated with a panel; override to provide a specialized tab item.

C#
protected virtual TabStripItem CreateTabItem(TabPanel tabPanel)
Parameters:tabPanelTabPanel

The panel represented by the item.

Returns:

TabStripItem

The item inserted into the page-view strip.

Creates the strip element used to display and reorder the tab items; override to supply a specialized element.

C#
protected virtual RadPageViewTabStripElement CreateTabStripElementInstance()
Returns:

RadPageViewTabStripElement

The tab-strip element hosted by this panel.

If the panel at the specified index is selected, selects the following panel or wraps to the first panel.

C#
public void DeselectTab(int index)
Parameters:indexint

The zero-based index of the panel to deselect.

Exceptions: ArgumentOutOfRangeException

index is outside the collection.

Deselects the named panel by selecting the following panel, or the first panel when the named panel is last.

C#
public void DeselectTab(string tabPanelName)
Parameters:tabPanelNamestring

The name of the panel to deselect.

Exceptions: ArgumentNullException

tabPanelName is null or no panel has that name.

Deselects the specified panel by selecting the following panel, or the first panel when it is last.

C#
public void DeselectTab(TabPanel tabPanel)
Parameters:tabPanelTabPanel

The panel to deselect.

Exceptions: ArgumentNullException

tabPanel is null.

ArgumentOutOfRangeException

tabPanel is not in TabPanels.

Detaches image-list and strip event handlers before disposing the panel.

C#
protected override void Dispose(bool disposing)
Parameters:disposingbool

true when managed resources should be released.

Overrides: RadControl.Dispose(bool)

Determines whether the tabstrip element is visible.

C#
protected virtual bool GetTabStripVisible()
Returns:

bool

Treats Home, End, Page Up, and Page Down as input keys, but does not treat Alt-modified keys as input keys.

C#
protected override bool IsInputKey(Keys keyData)
Parameters:keyDataKeys

The key and modifier combination to classify.

Returns:

bool

true for the listed navigation keys or when the base implementation accepts the key.

Overrides: RadControl.IsInputKey(Keys)

Provides a subclass hook after left-button movement exceeds the threshold for starting a panel drag.

C#
protected virtual void OnDragInitialized(Point mouse)
Parameters:mousePoint

The current pointer location in the tab-strip panel's client coordinates.

Selects the first panel when the stored index is invalid, then synchronizes the panel and strip selection unless selection updates are disabled.

C#
protected override void OnHandleCreated(EventArgs e)
Parameters:eEventArgs

Event data for handle creation.

Overrides: Control.OnHandleCreated(EventArgs)

Updates the active panel's bounds before the base layout pass.

C#
protected override void OnLayout(LayoutEventArgs e)
Parameters:eLayoutEventArgs

Layout event data.

Overrides: RadControl.OnLayout(LayoutEventArgs)

Clears the dragging flag when this control loses mouse capture.

C#
protected override void OnMouseCaptureChanged(EventArgs e)
Parameters:eEventArgs

Event data for the capture change.

Overrides: RadControl.OnMouseCaptureChanged(EventArgs)

Resets the drag origin and records the client location of a left-button press.

C#
protected override void OnMouseDown(MouseEventArgs e)
Parameters:eMouseEventArgs

The mouse input being processed.

Overrides: RadControl.OnMouseDown(MouseEventArgs)

Starts a panel drag after left-button movement passes the drag threshold.

C#
protected override void OnMouseMove(MouseEventArgs e)
Parameters:eMouseEventArgs

The mouse movement being processed.

Overrides: RadControl.OnMouseMove(MouseEventArgs)

Raises SelectedIndexChanged after the selected index is applied.

C#
protected virtual void OnSelectedIndexChanged(EventArgs e)
Parameters:eEventArgs

Event data for the completed selection change.

Raises SelectedIndexChanging so handlers can cancel the pending selection.

C#
protected virtual void OnSelectedIndexChanging(TabStripPanelSelectedIndexChangingEventArgs e)
Parameters:eTabStripPanelSelectedIndexChangingEventArgs

The old and requested panel indices and the cancel flag.

Handles the click of a CloseButton on a child TabStripItem. Closes the corresponding TabPanel by default.

C#
protected virtual void OnTabCloseButtonClicked(TabStripItem item)
Parameters:itemTabStripItem

Applies the new strip alignment to the page-view element and recalculates layout.

C#
protected virtual void OnTabStripAlignmentChanged(EventArgs e)
Parameters:eEventArgs

Event data for the alignment change.

Applies the new tab-text orientation to the strip and recalculates layout.

C#
protected virtual void OnTabStripTextOrientationChanged(EventArgs e)
Parameters:eEventArgs

Event data for the orientation change.

Recalculates layout after the control's theme changes.

C#
protected override void OnThemeChanged()

Overrides: RadControl.OnThemeChanged()

Requests selection of the panel at the specified index. The return value reflects whether SelectedIndex equals the requested index after the change event runs.

C#
public bool SelectTab(int index)
Parameters:indexint

The zero-based index of the panel to select.

Returns:

bool

false when the pending change is canceled; otherwise, whether the stored selected index equals index.

Exceptions: ArgumentOutOfRangeException

index is negative.

An index greater than or equal to TabPanels.Count is not rejected; it can be stored while leaving no panel selected.

Requests selection of a panel by its name, using a case-insensitive lookup.

C#
public bool SelectTab(string tabPanelName)
Parameters:tabPanelNamestring

The name of the panel to select.

Returns:

bool

true if the requested index is stored after the change event runs; otherwise, false.

Exceptions: ArgumentNullException

tabPanelName is null or no panel has that name.

Requests selection of the specified panel.

C#
public bool SelectTab(TabPanel tabPanel)
Parameters:tabPanelTabPanel

The panel to select.

Returns:

bool

true if the requested index is stored after the change event runs; otherwise, false.

Exceptions: ArgumentNullException

tabPanel is null.

ArgumentOutOfRangeException

tabPanel is not in TabPanels.

Returns the base control description with the panel count and, when present, the first panel's description.

C#
public override string ToString()
Returns:

string

A diagnostic string for this tab-strip panel.

Overrides: Component.ToString()

Sizes the selected panel to TabPanelBounds or updates strip visibility when no panel is selected.

C#
protected virtual void UpdateActivePanelBounds()

Callback to notify the panel that a control has been successfully removed, tab strip has been updated and any additional update is allowed.

C#
protected virtual void UpdateAfterControlRemoved(Control value)
Parameters:valueControl

Forces layout update by explicitly re-setting the current bounds and performing a layout pass.

C#
protected virtual void UpdateLayout()

Synchronizes the selected tab item and panel visibility with SelectedIndex, optionally moving focus into the selected panel.

C#
public virtual void UpdateTabSelection(bool updateFocus)
Parameters:updateFocusbool

true to move focus into the selected panel when it does not already contain focus and focus changes are not suspended.

Shows or collapses the tab items' visual container.

C#
protected virtual void UpdateTabStripVisibility(bool visible)
Parameters:visiblebool

true to show the item container; otherwise, collapse it.

Events

Occurs after a selected-index change is applied while the control handle is created.

C#
public event EventHandler SelectedIndexChanged

Occurs before the selected panel index changes; set Cancel to reject the change.

C#
public event TabStripPanelSelectedIndexChangingEventHandler SelectedIndexChanging