How to make a vertical Tabcontrol

Posts 1–5 of 5 · Page 1 of 1
How to make a vertical Tabcontrol




What you need:
1) Your Form
2) Tabcontrol


Let's start:



Go to your form and select Tabcontrol.
And change this this options:
Alignment = Left
SizeMode = Fixed
ItemSize = 30, 120
DrawMode = OwnerDrawFixed


Add this code between
Code:
Public Class Form2
  

End Class
Code:
Private Sub TabControl1_DrawItem(ByVal sender As Object, ByVal e As System.Windows.Forms.DrawItemEventArgs) Handles TabControl1.DrawItem
	Dim g As Graphics
	Dim sText As String
	Dim iX As Integer
	Dim iY As Integer
	Dim sizeText As SizeF
	Dim ctlTab As TabControl

	ctlTab = CType(sender, TabControl)

	g = e.Graphics

	sText = ctlTab.TabPages(e.Index).Text
	sizeText = g.MeasureString(sText, ctlTab.Font)
	iX = e.Bounds.Left + 6
	iY = e.Bounds.Top + (e.Bounds.Height - sizeText.Height) / 2
	g.DrawString(sText, ctlTab.Font, Brushes.Black, iX, iY)
End Sub

Done !



Hardly a tutorial lol. Just a C+P.
Quote Originally Posted by Jason View Post
Hardly a tutorial lol. Just a C+P.
C+P where everything started..:P just kidding..
Quote Originally Posted by Jason View Post
Hardly a tutorial lol. Just a C+P.
It's just a tutorial for if people need this.
It looks nicer with vertical bars.

I'm now programing a Theme'd one
Posts 1–5 of 5 · Page 1 of 1

Post a Reply

Similar Threads

Tags for this Thread

None

Talk with us