title: Prevent Button from inheriting BackColor of Parent
body: <p>When I have a parent control which has a <code>BackColor</code> other than <code>SystemColors.Control</code>, but I have buttons on that parent control that I want to be drawn in the system them. However, when I do not change the <code>BackColor</code> of the buttons, it's drawn in the color of the parent. When I change the <code>BackColor</code> of the button to <code>SystemColors.Control</code>, it isn't drawn in the Windows theme anymore.</p>
  
  <p><img src="https://i.stack.imgur.com/pdIhi.png" alt="alt text"><br>
  <em>The left version is with <code>SystemColors.Control</code> and the right is without changing the <code>BackColor</code>.</em></p>
  
  <p><img src="https://i.stack.imgur.com/7IvOe.png" alt="alt text"><br>
  <em>Blown up, it looks like this. Here you can see that the buttons have a solid background.</em></p>
  
  <p>Any suggestions how I can fix this?</p>
  
  <p>The effect in the image can be accomplished by creating a new .NET 2.0 WinForms project and changing the constructor of <code>Form1</code> to the following:</p>
  
  <pre><code>public Form1()
  {
      InitializeComponent();
  
      var textBox = new TextBox();
      Controls.Add(textBox);
  
      var button = new Button { Text = "L", Width = 23, Height = 18, Left = -1, Top = -1 };
      textBox.Controls.Add(button);
  
      // Disable the line below to get the default behavior
      button.BackColor = SystemColors.Control;
  }
  </code></pre>