VJ,
I would add two tab controls to the form, one with alignment Top & one with
alignment Left (or Right). I would either size both controls so only the
tabs were visible, or attempt to overlay & offset one control on top of the
other. Depending on what is being displayed in the center (what "Tab pages"
were being displayed.
If I went with overlaying & offset controls, I would handle the
Tabcontrol.Clic ked event to bring that control to the front.
Something like:
Public Class TabbedForm
Inherits System.Windows. Forms.Form
#Region " Windows Form Designer generated code "
Public Sub New()
MyBase.New()
'This call is required by the Windows Form Designer.
InitializeCompo nent()
'Add any initialization after the InitializeCompo nent() call
End Sub
'Form overrides dispose to clean up the component list.
Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
If disposing Then
If Not (components Is Nothing) Then
components.Disp ose()
End If
End If
MyBase.Dispose( disposing)
End Sub
'Required by the Windows Form Designer
Private components As System.Componen tModel.IContain er
'NOTE: The following procedure is required by the Windows Form Designer
'It can be modified using the Windows Form Designer.
'Do not modify it using the code editor.
Private WithEvents TabControl1 As System.Windows. Forms.TabContro l
Private WithEvents TabPage1 As System.Windows. Forms.TabPage
Private WithEvents TabPage2 As System.Windows. Forms.TabPage
Private WithEvents TabControl2 As System.Windows. Forms.TabContro l
Private WithEvents TabPage3 As System.Windows. Forms.TabPage
Private WithEvents TabPage4 As System.Windows. Forms.TabPage
Private WithEvents Label1 As System.Windows. Forms.Label
Private WithEvents Label2 As System.Windows. Forms.Label
Private WithEvents Label3 As System.Windows. Forms.Label
Private WithEvents Label4 As System.Windows. Forms.Label
<System.Diagnos tics.DebuggerSt epThrough()> Private Sub
InitializeCompo nent()
Me.TabControl1 = New System.Windows. Forms.TabContro l
Me.TabPage1 = New System.Windows. Forms.TabPage
Me.Label1 = New System.Windows. Forms.Label
Me.TabPage2 = New System.Windows. Forms.TabPage
Me.Label2 = New System.Windows. Forms.Label
Me.TabControl2 = New System.Windows. Forms.TabContro l
Me.TabPage3 = New System.Windows. Forms.TabPage
Me.Label3 = New System.Windows. Forms.Label
Me.TabPage4 = New System.Windows. Forms.TabPage
Me.Label4 = New System.Windows. Forms.Label
Me.TabControl1. SuspendLayout()
Me.TabPage1.Sus pendLayout()
Me.TabPage2.Sus pendLayout()
Me.TabControl2. SuspendLayout()
Me.TabPage3.Sus pendLayout()
Me.TabPage4.Sus pendLayout()
Me.SuspendLayou t()
'
'TabControl1
'
Me.TabControl1. Controls.Add(Me .TabPage1)
Me.TabControl1. Controls.Add(Me .TabPage2)
Me.TabControl1. Location = New System.Drawing. Point(32, 8)
Me.TabControl1. Name = "TabControl 1"
Me.TabControl1. SelectedIndex = 0
Me.TabControl1. Size = New System.Drawing. Size(256, 248)
Me.TabControl1. TabIndex = 0
'
'TabPage1
'
Me.TabPage1.Con trols.Add(Me.La bel1)
Me.TabPage1.Loc ation = New System.Drawing. Point(4, 25)
Me.TabPage1.Nam e = "TabPage1"
Me.TabPage1.Siz e = New System.Drawing. Size(248, 219)
Me.TabPage1.Tab Index = 0
Me.TabPage1.Tex t = "TabPage1"
'
'Label1
'
Me.Label1.Locat ion = New System.Drawing. Point(72, 80)
Me.Label1.Name = "Label1"
Me.Label1.TabIn dex = 0
Me.Label1.Text = "Label1"
'
'TabPage2
'
Me.TabPage2.Con trols.Add(Me.La bel2)
Me.TabPage2.Loc ation = New System.Drawing. Point(4, 25)
Me.TabPage2.Nam e = "TabPage2"
Me.TabPage2.Siz e = New System.Drawing. Size(248, 219)
Me.TabPage2.Tab Index = 1
Me.TabPage2.Tex t = "TabPage2"
'
'Label2
'
Me.Label2.Locat ion = New System.Drawing. Point(72, 80)
Me.Label2.Name = "Label2"
Me.Label2.TabIn dex = 0
Me.Label2.Text = "Label2"
'
'TabControl2
'
Me.TabControl2. Alignment = System.Windows. Forms.TabAlignm ent.Left
Me.TabControl2. Controls.Add(Me .TabPage3)
Me.TabControl2. Controls.Add(Me .TabPage4)
Me.TabControl2. Location = New System.Drawing. Point(8, 32)
Me.TabControl2. Multiline = True
Me.TabControl2. Name = "TabControl 2"
Me.TabControl2. SelectedIndex = 0
Me.TabControl2. Size = New System.Drawing. Size(280, 224)
Me.TabControl2. TabIndex = 1
'
'TabPage3
'
Me.TabPage3.Con trols.Add(Me.La bel3)
Me.TabPage3.Loc ation = New System.Drawing. Point(25, 4)
Me.TabPage3.Nam e = "TabPage3"
Me.TabPage3.Siz e = New System.Drawing. Size(251, 216)
Me.TabPage3.Tab Index = 0
Me.TabPage3.Tex t = "TabPage3"
'
'Label3
'
Me.Label3.Locat ion = New System.Drawing. Point(72, 80)
Me.Label3.Name = "Label3"
Me.Label3.TabIn dex = 0
Me.Label3.Text = "Label3"
'
'TabPage4
'
Me.TabPage4.Con trols.Add(Me.La bel4)
Me.TabPage4.Loc ation = New System.Drawing. Point(25, 4)
Me.TabPage4.Nam e = "TabPage4"
Me.TabPage4.Siz e = New System.Drawing. Size(251, 216)
Me.TabPage4.Tab Index = 1
Me.TabPage4.Tex t = "TabPage4"
'
'Label4
'
Me.Label4.Locat ion = New System.Drawing. Point(72, 80)
Me.Label4.Name = "Label4"
Me.Label4.TabIn dex = 0
Me.Label4.Text = "Label4"
'
'TabbedForm
'
Me.AutoScaleBas eSize = New System.Drawing. Size(6, 15)
Me.ClientSize = New System.Drawing. Size(292, 260)
Me.Controls.Add (Me.TabControl2 )
Me.Controls.Add (Me.TabControl1 )
Me.Name = "TabbedForm "
Me.Text = "TabbedForm "
Me.TabControl1. ResumeLayout(Fa lse)
Me.TabPage1.Res umeLayout(False )
Me.TabPage2.Res umeLayout(False )
Me.TabControl2. ResumeLayout(Fa lse)
Me.TabPage3.Res umeLayout(False )
Me.TabPage4.Res umeLayout(False )
Me.ResumeLayout (False)
End Sub
#End Region
Private Sub TabControl1_Cli ck(ByVal sender As System.Object, ByVal e As
System.EventArg s) Handles TabControl1.Cli ck, TabControl2.Cli ck
Dim tc As TabControl = DirectCast(send er, TabControl)
tc.BringToFront ()
End Sub
End Class
Hope this helps
Jay
"VJ" <vi********@yah oo.com> wrote in message
news:u1******** ******@TK2MSFTN GP11.phx.gbl...
I am looking to have 2 Tab Controls on a Windows Forms.. One with Tabs on
Top and another with Tabs on the side... I want them both to occupy the
entire area of the form, but I need the Tab Headers to be visible for both
of them .. at all times... How do I accomplish this?
Also can One Tab control have Tab Headers on Top and Side.. at the same
time?..That might solve this problem easily :-)
Thanks
Vijay