日期:2014-05-18  浏览次数:21349 次

C# winform中 tabcontrol 给选项卡被选中或没被选中设置背景图,如何处理?
C# winform中 tabcontrol 给选项卡被选中或没被选中设置背景图,如何处理?

------解决方案--------------------
别美化了,有现成的美化好的,加我QQ我发你吧,Inval@live.cn 答案'wwwwwww
------解决方案--------------------
private void tabControl_SelectedTabChanged(object sender, EventArgs e)
{
if (tabControl.SelectedTabIndex == 0)
{
try
{
tabControl.Tabs[0].Image = Image.FromFile(Application.StartupPath + @"\Image\mainImage\12.png");
tabControl.Tabs[1].Image = Image.FromFile(Application.StartupPath + @"\Image\mainImage\2.png");
tabControl.Tabs[2].Image = Image.FromFile(Application.StartupPath + @"\Image\mainImage\3.png");
tabControl.Tabs[3].Image = Image.FromFile(Application.StartupPath + @"\Image\mainImage\4.png");
}catch(Exception){}
}
}