How To - Display Side-Aligned Tabs With TabControl - Windows Forms .NET Framework - Microsoft Docs
How To - Display Side-Aligned Tabs With TabControl - Windows Forms .NET Framework - Microsoft Docs
TabControl
03/30/2017 • 2 minutes to read •
In this article
See also
The Alignment property of TabControl supports displaying tabs vertically (along the left
or right edge of the control), as opposed to horizontally (across the top or bottom of
the control). By default, this vertical display results in a poor user experience, because
the Text property of the TabPage object does not display in the tab when visual styles
are enabled. There is also no direct way to control the direction of the text within the
tab. You can use owner draw on TabControl to improve this experience.
The following procedure shows how to render right-aligned tabs, with the tab text
running from left to right, by using the "owner draw" feature.
tabControl1.DrawItem += new
DrawItemEventHandler(tabControl1_DrawItem);
}
if (e.State == DrawItemState.Selected)
{
See also
TabControl Control
Is this page helpful?
Yes No