Click here to Skip to main content
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 14-Sep-12 0:49am
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 Maciej Los 474
1 ridoy 420
2 DamithSL 180
3 OriginalGriff 179
4 Richard MacCutchan 160
0 OriginalGriff 8,033
1 DamithSL 6,179
2 Sergey Alexandrovich Kryukov 5,538
3 Maciej Los 5,508
4 Kornfeld Eliyahu Peter 4,539


Advertise | Privacy | Mobile
Web04 | 2.8.141223.1 | Last Updated 14 Sep 2012
Copyright © CodeProject, 1999-2014
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