Click here to Skip to main content
12,818,785 members (27,897 online)
Rate this:
Please Sign up or sign in to vote.
See more: C#3.0 C#
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
Posted 14-Sep-12 0:49am
Rate this: bad
Please Sign up or sign in to vote.

Solution 1

Check out this [^] CP article. Should give you what you want!
Rate this: bad
Please Sign up or sign in to vote.

Solution 2

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";

Hope it helps.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

    Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.170308.1 | Last Updated 14 Sep 2012
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100