Change sheet tab back color

Posted by: xgsoftware on 8 September 2017, 2:38 pm EST

  • Posted 8 September 2017, 2:38 pm EST

    I want to change the back color of a sheet tab with sheet tab index,I found the way from the help document,the code like this:

    <FONT face="Courier New">fpSpread1.InterfaceRenderer = <FONT color=blue>null</FONT></FONT><FONT face="Courier New" color=black>;
    fpSpread1.VisualStyles = FarPoint.Win.VisualStyles.Off;
    FarPoint.Win.Spread.SheetTab st;
    st = fpSpread1.TabStrip.ActiveSheetTab;
    st.BackColor = Color.Red; </FONT>

    <FONT face="Courier New">however if I set the InterfaceRenderer = null , the fpSpread1 will change the skin of the </FONT>

    <FONT face="Courier New">sheet tab area, how can i change the sheet tab back color ,at the same time the sheet tab skin </FONT>

    <FONT face="Courier New">do not change? thanks for your help</FONT>

  • Replied 8 September 2017, 2:38 pm EST

    This code will accomplish it.

    <SPAN style="FONT-FAMILY:Consolas;FONT-SIZE:9.5pt;">FarPoint.Win.Spread.<SPAN style="COLOR:#2b91af;">EnhancedInterfaceRenderer</SPAN> eir = <SPAN style="COLOR:blue;">new</SPAN> FarPoint.Win.Spread.<SPAN style="COLOR:#2b91af;">EnhancedInterfaceRenderer</SPAN>();<o:p></o:p></SPAN>

    <SPAN style="FONT-FAMILY:Consolas;FONT-SIZE:9.5pt;">eir.SheetTabLowerActiveColor = <SPAN style="COLOR:#2b91af;">Color</SPAN>.Red;<o:p></o:p></SPAN>

    <SPAN style="FONT-FAMILY:Consolas;FONT-SIZE:9.5pt;">eir.SheetTabUpperActiveColor = <SPAN style="COLOR:#2b91af;">Color</SPAN>.Pink;<o:p></o:p></SPAN>

    <SPAN style="FONT-FAMILY:Consolas;FONT-SIZE:9.5pt;">fpSpread1.InterfaceRenderer = eir;<o:p></o:p></SPAN>


  • Replied 8 September 2017, 2:38 pm EST

    thanks paul

    your code can set the active sheet tab color,but what I want like this: there are many sheets in spread

    I want to set the sheet1 tab back color to Red,the sheet2 tab back color to green,the sheet3 tab back color to blue......

    every sheet has it's own sheet tab back color but not only the active sheet tab has back color, How to do this

    thank you

  • Replied 8 September 2017, 2:38 pm EST


    For each sheet tab in the tab strip to have a different color, we can use Spread's Tabstrip's Backcolor property for the same. Here is the code for the same.

    <blockquote>        System.Drawing.ColorConverter obj;
            private void Form1_Load(object sender, EventArgs e)
                fpSpread1.Sheets.Count = 4;
                int sheetcount = fpSpread1.Sheets.Count;
                fpSpread1.InterfaceRenderer = null;

                fpSpread1.VisualStyles = FarPoint.Win.VisualStyles.Off;
                obj = new ColorConverter();
                string[] knowncolors = System.Enum.GetNames(typeof(KnownColor));

                int count1 = knowncolors.Length-1;

                for (int j = 0; j < sheetcount; j++)
                    if (count1 >= 0)
                        fpSpread1.TabStrip[j].BackColor = (Color)obj.ConvertFromString(knowncolors[count1]);

                        count1 = count1 - 4;

    Hope this will help you. Thanks.

  • Replied 8 September 2017, 2:38 pm EST

    <FONT face="Courier New">thanks Reeva Dhingra ,your code can set each sheet tab with diffrent back color ,but with this statment</FONT>

    <FONT face="Courier New">fpSpread1.InterfaceRenderer = null;, the fpSpread1 will change the skin of the </FONT>

    <FONT face="Courier New">sheet tab area from default to classic, I don't want to change the skin of sheet tab,</FONT>

    <FONT face="Courier New">I want to set each sheet tab with diffrent back color,and at the same time the skin of sheet tab do not change</FONT>

    <FONT face="Courier New">thanks</FONT>

  • Replied 8 September 2017, 2:38 pm EST


    It is mandatory to set the interface renderer to
    null before you actually customize the tab strip, it is even mentioned in the
    documentation as well. You can have a look here. And as soon as we set the interface renderer to null the default skin changes which is an expected behaviour.


Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels