Category:Data recoveryQ:
How to move the Default.png image of the TabItem to another position of the tabcontrol?
I am using Visual Studio 2010 and Winforms. I have a TabControl with a list of TabItems. Each TabItem has a BackColor to which I wish to set a different color. The problem is that when a user navigates from a TabItem to another one, the default background color of the tab item is applied to all the other tabs until the user navigates to the first one again. How do I prevent this from happening? I want to set the default.png to a different color in each TabItem.
Below is my code:
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
tabControl1.SelectedTab = tabItem1;
}
private void tabItem1_Click(object sender, EventArgs e)
{
tabControl1.SelectedTab = tabItem2;
}
private void tabItem2_Click(object sender, EventArgs e)
{
tabControl1.SelectedTab = tabItem3;
}
private void tabItem3_Click(object sender, EventArgs e)
{
tabControl1.SelectedTab = tabItem4;
}
private void tabItem4_Click(object sender, EventArgs e)
{
tabControl1.SelectedTab = tabItem5;
}
private void tabItem5_Click(object sender, EventArgs e)
{
tabControl1.SelectedTab = tabItem6;
}
private void tabItem6_Click(object sender, EventArgs e)
{
tabControl1.SelectedTab = tabItem7;
}
private void tabItem7_Click(object sender, EventArgs e)
{
tabControl1.SelectedTab = tabItem8;
}
private void tabItem8_Click(object sender, EventArgs e)
{
tabControl1.SelectedTab = tabItem9;
}
private void tabItem9_Click(object sender, be359ba680
Related links:
Comments