title: Form transparency
body: <p>I'm in progress with my first application in visual basic, and I'm using the visual basic studio... I have created a form, with buttons - form has an background image with rounded corners and I can not set its color to "transparent" because the following error occurs:</p>
  
  <p><code>Control does not support transparent background colors.</code></p>
  
  <p>Now I have no idea what to do. I have read that I can set the transparency in the code, by adding the following lines:</p>
  
  <pre><code>SetStyle(ControlStyles.SupportsTransparentBackColor, True)
  Me.BackColor = Color.Transparent
  </code></pre>
  
  <p>But it doesn't seem to work... So what else can I do?</p>
  
  <p>The whole code:</p>
  
  <pre><code>Public Class Form1
  
    Private Sub Button1_Click(ByVal sender As Object, ByVal e As EventArgs) Handles Button1.Click
      MsgBox("Test", 32, "Button Click")
    End Sub
  
    Private Sub Button2_Click(ByVal sender As Object, ByVal e As EventArgs) Handles Button2.Click
      Close()
    End Sub
  
    Private Sub Form1_Load(ByVal sender As Object, ByVal e As EventArgs) Handles MyBase.Load
      SetStyle(ControlStyles.SupportsTransparentBackColor, True)
      Me.BackColor = Color.Transparent
    End Sub
  
  End Class
  </code></pre>