how to make the layout of a tabcontrol right to left?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi all,
the tabcontrol displays tabpages buttons from left to right, how can I
mirror it so it will start from the right?
 
You can create your own Mirrorable (that may not be a real word) Tabcontrol.

A VB solution.
Inherit from TabControl and place the following code in the class.

\\\
Protected Overrides ReadOnly Property CreateParams() As
System.Windows.Forms.CreateParams
Get
Dim cp As CreateParams = MyBase.CreateParams
Const WS_EX_LAYOUTRTL As Integer = &H400000
Const WS_EX_NOINHERITLAYOUT As Integer = &H100000
If Me.Mirror Then
cp.ExStyle += WS_EX_LAYOUTRTL Or WS_EX_NOINHERITLAYOUT
End If
Return cp
End Get
End Property

Private m_Mirror As Boolean = False

Public Property Mirror() As Boolean
Get
Return m_Mirror
End Get
Set(ByVal Value As Boolean)
If m_Mirror = Value Then Return
m_Mirror = Value
MyBase.UpdateStyles()
End Set
End Property
///
 
Back
Top