BackColor being changed behind my back!

2 posts, 0 answers
  1. DukeVideo
    DukeVideo avatar
    48 posts
    Member since:
    Jun 2006

    Posted 30 Oct 2007 Link to this post

    Hi,

    I have set the BackColor of the RadTabStrip to (228, 238, 250), and it works in the Designer. This even produces the code in InitialiseComponent():

    this.radTabStrip.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(228)))), ((int)(((byte)(238)))), ((int)(((byte)(250)))));

    Yet, when I Build and Run, the colour changes in the designer and at runtime to ControlLightLight.

    Any ideas?

  2. Nikolay
    Admin
    Nikolay avatar
    1803 posts

    Posted 01 Nov 2007 Link to this post

    Hello DukeVideo,

    Thank you for this question.

    This happens because RadTabStrip takes into account the theme applied to it until the initialization process of the components finishes. When you change the BackColor property from the designer, as you have noticed, a line for this change is placed into the InitializeComponent(), and since this line is not a part from the theme, it does not reflect on the look of the control at run-time.

    In general, there are two ways to change the BackColor of RadTabStrip.The first one is to use our Visual Style Builder to make a theme. The second one is to put the code line for the BackColor property after the InitializeComponent() in the Form constructor or in the Form_Load event handler.

    If you have any questions, do not hesitate to contact us.

    Greetings,
    Nikolay
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  3. UI for WinForms is Visual Studio 2017 Ready
Back to Top