I've made a program with a transparent background image using the following code in the form_load sub.
I have a timer set to 1 second, that I want to use to change the background. I tried this code to change the picture every second.
This causes the window to revert to grey.
Any ideas? Thanks.
Code:
Me.SetStyle(ControlStyles.SupportsTransparentBackColor, True)
Me.BackColor = Color.Transparent
Dim img As Bitmap = CType(Me.BackgroundImage, Bitmap)
Me.FormBorderStyle = Windows.Forms.FormBorderStyle.None
Me.TransparencyKey = img.GetPixel(2, 2)
Code:
Beat = Beat + 1
If Beat = 1 Then Me.BackgroundImage = My.Resources.ResourceManager.GetObject("Heart1.png")
If Beat = 2 Then Me.BackgroundImage = My.Resources.ResourceManager.GetObject("Heart2.png") : Beat = 0
Any ideas? Thanks.