vb.nettransparencyborderless

Make the form's background to transparent


I made a borderless form and I set my background image (in PNG format) to something like the one shown in the image below. What I want is to make the form's background transparent so that only the circular image is shown. I tried changing the form's BackColor to Transparent but I'm getting an error saying Property value is not vald

image


Solution

  • Try this

    Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
        Me.BackColor = Color.Transparent
    End Sub
    

    (or)

    Call the SetStyle method of your form in the constructor.

    SetStyle(ControlStyles.SupportsTransparentBackColor, True)