title: Disabling visual styles for ToolStripDropDownMenu
body: <p>I'm trying to prevent <code>MenuStrip</code> control to be affected by visual styles.</p>
  
  <p>So I've created simple form with simple menu strip and disabled visual styles in <code>Main()</code>:</p>
  
  <pre class="lang-cs prettyprint-override"><code>// Application.EnableVisualStyles(); &lt;-- no visual styles
  Application.SetCompatibleTextRenderingDefault(false);
  Application.Run(new Form1());
  </code></pre>
  
  <p>which yields this appearance (note grey border and background):</p>
  
  <p><img src="https://i.stack.imgur.com/5d2iv.png" alt="enter image description here"></p>
  
  <p>Now I want to do the same in the way that other controls of this form are affected by visual styles (I want to disable visual styles for this drop down only).</p>
  
  <p>So at first I tried to disable visual styles for <code>DropDown</code> of every <code>ToolStripMenuItem</code>, but it didn't work. Then I tried to disable visual styles for whole <code>MenuStrip</code>, but neither that one worked.</p>
  
  <p>Here's the code of my custom MenuStrip:</p>
  
  <pre class="lang-cs prettyprint-override"><code>class MPMenuStrip : MenuStrip
  {
      [DllImportAttribute("uxtheme.dll")]
      private static extern int SetWindowTheme(IntPtr hWnd, string appname, string idlist);
  
      protected override void OnHandleCreated(EventArgs e)
      {
          // first attempt:
          foreach (ToolStripMenuItem menuItem in this.Items)
              SetWindowTheme(menuItem.DropDown.Handle, "", "");
  
          // second attempt:
          SetWindowTheme(this.Handle, "", "");
          base.OnHandleCreated(e);
      }
  }
  </code></pre>
  
  <p>Despite of using of custom <code>MenuStrip</code> control, when <code>Application.EnableVisualStyles();</code> in <code>Main()</code> is being called, the appearance of form is following (blue):</p>
  
  <p><img src="https://i.stack.imgur.com/fiZVU.png" alt="enter image description here"></p>
  
  <p>Any ideas what else could possibly affect the appearance of this dropdown?<br>
  What am I missing?</p>
  
  <p>Thanks.</p>