title: Make ListBox transparent (a DLL solution exists in VB, why not C#?)
body: <p>I need to make a listbox transparent.  I found code in VB.NET that does the trick.  However, how could I implement this in C#?</p>
  
  <p>HERE IS THE VB CODE:</p>
  
  <pre><code>            Option Explicit
              Private Const WS_EX_TRANSPARENT = &amp;H20&amp;
              Private Const GWL_EXSTYLE = (-20)
              Private Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
  
              Public Function MakeListTransparent(ListCtl As Object) As Boolean
  
                  On Error Resume Next
                  ListCtl.BackColor = ListCtl.Parent.BackColor
                  SetWindowLong ListCtl.hwnd, GWL_EXSTYLE, WS_EX_TRANSPARENT
                  MakeListTransparent = Err.LastDllError = 0
  
              End Function
  </code></pre>
  
  <p>AND HERE IS MY C# ATTEMPT:</p>
  
  <pre><code>    public const int WS_EX_TRANSPARENT = 0x20;
      public const int GWL_EXSTYLE = (-20);
  
      [DllImport("user32.dll")]
      static extern int SetWindowLong(IntPtr hWnd, int nIndex, UInt32 dwNewLong);
  
      //somewhere in my form:
      listBox1.BackColor = Color.AliceBlue; // &lt;-- to see an INITIAL color
      SetWindowLong(listBox1.Handle, GWL_EXSTYLE, WS_EX_TRANSPARENT); // &lt;-- to see if it turns TRANSPARENT
  </code></pre>
  
  <p>Am I not translating this from VB to C# correctly?  Is there a better method?  I desperately need to make a listbox transparent...</p>