title: How can I set a form to have a transparent background
body: <p>I am struggling to get my form to have a transparent background in vb.net </p>
  
  <p>Currently in the form New I set </p>
  
  <pre><code>Me.SetStyle(ControlStyles.SupportsTransparentBackColor, true) 
  </code></pre>
  
  <p>But still the form shows up as having the default grey background</p>
  
  <p>Can anyone help??</p>
  
  <p>EDIT: I need the controls on the form to be visible so I don't think setting the opacity to 0 will work</p>
  
  <p>EDIT: I tried the transparency key solution  but it doesn't work. I have a circular image with a black background. OnPaint I set the transparency key to the img pixel at 0,0, this then leaves me with circular image (which I want ) It hides the black background but I am still left with the default grey rectangle of the form. </p>
  
  <p>below is the code I have - </p>
  
  <pre><code>Public Sub New()
  
      Me.SetStyle(ControlStyles.SupportsTransparentBackColor, True)
      Me.BackColor = Color.Transparent
      ' This call is required by the Windows Form Designer.
      InitializeComponent()
  
      ' Add any initialization after the InitializeComponent() call.
      Me.Timer1.Start()
  End Sub
  
  Private Sub frmWoll_Paint(ByVal sender As Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles Me.Paint
  
      Dim img As Bitmap = CType(Me.BackgroundImage, Bitmap)
  
      img.MakeTransparent(img.GetPixel(2, 2))
      Me.TransparencyKey = img.GetPixel(2, 2)
  End Sub
  </code></pre>