Tabcontrol的颜色选项卡 [英] color tab of Tabcontrol

查看:128
本文介绍了Tabcontrol的颜色选项卡的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好
我有一个包含5个TabPage的TabControl,当我单击一个按钮时,它会更改颜色标签,然后转到下一个标签页
谢谢

Hello
I have a TabControl that contains 5 TabPage I want when I clicked on a button changes the color tab and I go to the next tabpage
thank you

推荐答案

查看 [ ^ ] CP文章.应该给您您想要的!
Check out this [^] CP article. Should give you what you want!


在页面上保留一个隐藏字段,该字段将存储页面的当前选项卡索引,并将该隐藏字段的值默认设置为0.
然后尝试以下是您的代码:
Take a hidden field on the page which will store the current tab index of the page and set the value of that hidden field to 0 by default.
Then try this is your code:
protected void btn_click(object sender, EventArgs e)
{
    hdfTabIndex.Value = (Convert.ToInt32(hdfTabIndex.Value)+1).ToString();
    ctlTabContainer.ActiveTabIndex = Convert.ToInt32(hdfTabIndex.Value)+1;
    /*Change your button style here*/
    btnNext.ForeColor = Color.Blue;
    btnNext.Text = hdfTabIndex.Value + "Tab";
}




希望对您有所帮助.
--Amit




Hope it helps.
--Amit


这篇关于Tabcontrol的颜色选项卡的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆