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?
Asked
Active
Viewed 547 times
2 Answers
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.
-
1The vb.net equivalent of C# hex suffix `0x` is `&H`. So you can replace `Convert.ToInt32("0x1328", 16)` with `&H1328`. – Bjørn-Roger Kringsjå Sep 21 '14 at 08:05
-
That's true. I will change this. The cast is definitely unnecessary. – Jens Sep 21 '14 at 08:08
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