-1

I want To hide Tabs Layout (that are at the top of TabControl) when the Application is running. But i need them to be visible when i am designing the form. Can anyone help me, please?

2 Answers2

0

From Hans Passant at Hide Tab Header on C# TabControl

Direct link: https://stackoverflow.com/a/6954785/3055288

Public Class TablessControl
    Inherits System.Windows.Forms.TabControl
    Protected Overrides Sub WndProc(ByRef m As System.Windows.Forms.Message)
        ' Hide tabs by trapping the TCM_ADJUSTRECT message
        If (m.Msg = &H1328 And Not DesignMode) Then
            m.Result = CType(1, IntPtr)
        Else
            MyBase.WndProc(m)
        End If
    End Sub
End Class

I translated his code to VB.NET and I'm using it myself. It works very nicely.

Community
  • 1
  • 1
Jens
  • 6,275
  • 2
  • 25
  • 51
0

Late answer, and I know ones already been accepted, but this is how I do it

With TabControl1
    .Appearance = TabAppearance.FlatButtons
    .ItemSize = New Size(0, 1)
    .SizeMode = TabSizeMode.Fixed
End With
LBPLC
  • 1,570
  • 3
  • 27
  • 51