Q:

Winforms ToolStrip.BackColor returns wrong color

The origin of my problem
I created a very simple dummy application in C# using winforms. It contains only a ToolStrip and a TrackBar inside that ToolStrip. The TrackBar should have the same BackColor as the ToolStrip, but it seems, that the property ToolStrip.BackColor does not return the actual background color.
public Form1()
{
    //// Here the ToolStrip is created.
    //// This code is generated by the designer.
    this.InitializeComponent();
    //// Here the the TrackBar is created.
    //// I think this is impossible to do via the Designer.
    this.CreateSpeedSlider();
}

private void CreateSpeedSlider()
{
    this.toolStrip.SuspendLayout();
    this.speedSlider = new TrackBar
    {
        TickStyle = TickStyle.None,
        AutoSize = false,
        Height = this.toolStrip.Height,
        Minimum = 0,
        Maximum = 10,
        BackColor = this.toolStrip.BackColor,
    };

    this.toolStrip.Items.Add(new ToolStripControlHost(this.speedSlider));
    this.toolStrip.ResumeLayout();
}

The result is a white TrackBar on a light grey ToolStrip. So it seems that
this.toolStrip.BackColor

does not return the back color of the ToolStrip that is actually used to draw it.
However...
If I change my function to
private void CreateSpeedSlider()
{
    this.toolStrip.BackColor = this.toolStrip.BackColor;
    ...
}

I get a white slider on a white ToolStrip. So ... assigning the value of the property to itself actually changes the color from light grey to white???
So the question is...
Is there any good way to retrieve the correct background color of a ToolStrip without such 'hacks'?
And is this behaviour intentional or am I missing something?

A:

BackColor is an ambient property
Control.BackColor is an ambient property:

The BackColor property is an ambient property. An ambient property is a control property that, if not set, is retrieved from the parent control. For example, a Button will have the same BackColor as its parent Form by default. For more information about ambient properties, see the AmbientProperties class or the Control class overview.

It means that it is implemented like this (source):
public virtual Color BackColor
{
     get
     {
          Color c = RawBackColor; // inheritedProperties.BackColor
          if (!c.IsEmpty)
          {
               return c;
          }
          Control p = ParentInternal;
          if (p != null && p.CanAccessProperties)
          {
               c = p.BackColor;
               if (IsValidBackColor(c))
               {
                    return c;
               }
          }
          ...

There's an internal property RawBackColor which is the color explicitly set for this particular control. BackColor itself is calculated - if the color was not explicitly set for this control it will try to return the BackColor of its parent.
ToolStrip is rendered differently.
To implement different styling for menus ToolStrip supports configurable rendering:

ToolStrip classes implement a rendering scheme that is significantly different from other Windows Forms controls. With this scheme, you can easily apply styles and themes.

What it means, is that ToolStrip has a Renderer and that renderer's initialization depends on system settings. So, in general there's no easy way to get the back color of a toolstrip.
Odds are good that by default ToolstripProfessionalRenderer is used. This type of renderer actually paints the background with a gradient. It has a ColorTable  property which, in its turn, defines MenuStripGradientBegin and MenuStripGradientEnd.
So, in most (but not all) cases, you can determine the default back color for a toolstip this way:
var renderer = (ToolStripProfessionalRenderer)toolStrip.Renderer;
Console.WriteLine(renderer.ColorTable.MenuStripGradientBegin);
Console.WriteLine(renderer.ColorTable.MenuStripGradientEnd);

If you try to host a control with a uniformly-painted background, such as TrackBar, it will probably stick out in a gradient-filled toolstrip.
ToolStripRenderer takes explictily set color into account
I couldn't find this behaviour documented anywhere, but according to ToolStripRenderer source, background is only painted (filled with gradient) if tool strip's RawBackColor is not set:
internal bool ShouldPaintBackground(Control control)
{
    return (control.RawBackColor == Color.Empty && control.BackgroundImage == null);
}

So, if you explicitly set ToolStrip.BackColor to any color, then the renderer will just use this color as a back color. This confusing behaviour explains why:
toolStrip.BackColor = toolStrip.BackColor;

has an actual effect.
What to do now?
I can see multiple ways forward, none of them good:

Set the BackColor for both tool strip and track bar to some known color. This will kill the beautiful, beautiful gradient in toolstrip background. If you don't care much about gradient that's the easiest way to go.
Make the hosted control transparent, so the toolstrip's background shows through. This will not work for TrackBar as it doesn't support transparent background, for some reason. See this question, for possible options (I didn't try any of them): Trackbar Background in a TabControl.
Override track bar's OnPaint and fill it with a gradient, so that it blends in with a tool strip's background. This sounds problematic, but doable.

