Click here to Skip to main content
11,648,785 members (80,290 online)
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C#3.0
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
Posted 13-Sep-12 23:49pm
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

Check out this [^] CP article. Should give you what you want!
  Permalink  
Rate this: bad
good
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.
--Amit
  Permalink  

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

  Print Answers RSS
0 CPallini 370
1 F-ES Sitecore 364
2 OriginalGriff 324
3 Kornfeld Eliyahu Peter 324
4 Sergey Alexandrovich Kryukov 254
0 OriginalGriff 1,512
1 Sergey Alexandrovich Kryukov 1,022
2 jyo.net 994
3 DamithSL 986
4 CPallini 945


Advertise | Privacy | Mobile
Web03 | 2.8.150804.4 | Last Updated 14 Sep 2012
Copyright © CodeProject, 1999-2015
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