Hi!
I have two tabcontrols (tabControl1 and tabControl2). The first one have two pages (tabPage1 and tabPage2). The second tabControl have three pages (tabPage1, tabPage2 and tabPage3).
Then I want to move on those two TabControls anytime I want . Means if I click on the first tabControl1's page, the second "tabControl2" move on taking the last tabControl' location after to have clicked. And so on with the other tabControl...
In conclusion, I would like to see it taking the location where the last tabcontrol have been before to be clicked.
Look My codes but doesnt work properly:
private void tabControl1_Click(object sender, EventArgs e)
{
tabControl1.Location.Y = 277;
tabControl1.Location.Y = 183;
}
private void tabControl2_Click(object sender, EventArgs e)
{
tabControl2.Location.Y = 277;
tabControl2.Location.Y = 183;
}
Thanx,
Israel.
Dipankar BiswasPosted Aug 27, 2014, 2:50 PM
using System.Drawing;
using System.Windows.Forms;
public class Form1 : Form
{
private TabControl tabControl1;
private TabPage tabPage1;
private TabPage tabPage2;
public Form1()
{
this.tabControl1 = new TabControl();
this.tabPage1 = new TabPage();
this.tabPage2 = new TabPage();
// Sizes the tabs of tabControl1.
this.tabControl1.ItemSize = new Size(90, 50);
// Makes the tab width definable.
this.tabControl1.SizeMode = TabSizeMode.Fixed;
this.tabControl1.Controls.AddRange(new Control[] {
tabPage1, tabPage2});
this.tabControl1.Location = new Point(35, 25);
this.tabControl1.Size = new Size(220, 220);
this.Size = new Size(300, 300);
this.Controls.Add(tabControl1);
}
static void Main()
{
Application.Run(new Form1());
}
}