Today I will tell you about usingTab Control in a Window Application Form. The Tab Control is mainly used to show ourWinForms together as aTabPages. Also I am going to share that how to add TabPages at run time or we can say that addTabpages dynamically. In this project you will learn many useful things about C# WinForms andTab Control.
Free Download
more article
Form2 frm = new Form2();
frm.TopLevel = false;
frm.Visible = true;
frm.FormBorderStyle = FormBorderStyle.None;
frm.Dock = DockStyle.Fill;
tabControl1.TabPages[0].Controls.Add(frm);
frm.TopLevel = false;
frm.Visible = true;
frm.FormBorderStyle = FormBorderStyle.None;
frm.Dock = DockStyle.Fill;
tabControl1.TabPages[0].Controls.Add(frm);
Friend WithEvents panelForm1 As panelForm
Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Try
'
'panelForm1
'
Me.panelForm1 = New ValidZoneExtracurricularTasks.SyncForm
Me.panelForm1.ClientSize = New System.Drawing.Size(673, 228)
Me.panelForm1.Dock = System.Windows.Forms.DockStyle.Fill
Me.panelForm1.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None
Me.panelForm1.Location = New System.Drawing.Point(3, 3)
Me.panelForm1.Name = "panelForm1"
Me.panelForm1.Text = "panelForm1"
Me.panelForm1.Visible = False
Me.panelForm1.Dock = DockStyle.Fill
Me.panelForm1.TopLevel = False
Me.tpgSync.Controls.Add(Me.SyncForm1)
Me.SyncForm1.Show()
Catch ex As Exception
End Try
End Sub
private void button1_Click(object sender, EventArgs e)
{
Form1 frm = new Form1();
frm.TopLevel = false;
frm.FormBorderStyle = FormBorderStyle.FixedToolW
frm.Dock = DockStyle.Fill;
frm.FormClosed += new FormClosedEventHandler(frm
TabPage tp = new TabPage();
frm.Tag = tp;
tp.Controls.Add(frm);
frm.Show();
tabControl1.TabPages.Add(t
}
void frm_FormClosed(object sender, FormClosedEventArgs e)
{
Form frm = (Form)sender;
tabControl1.TabPages.Remov
}
No comments:
Post a Comment