I have put the following in my Form1_Load event:
Dim Img As Bitmap = New Bitmap(1, 1)
Img.SetPixel(0, 0, Color.Green)
BackgroundImage = Img
TransparencyKey = Img.GetPixel(0, 0)
This makes the background green. It should make the background transparent.
If you comment out the second line, it actually works properly. However, I
need the image to be green.
Any ideas?
Matthew
Ken Tucker [MVP] - 18 Oct 2004 01:31 GMT
Hi,
Why not try something like this
Private Sub Form1_Paint(ByVal sender As Object, ByVal e As
System.Windows.Forms.PaintEventArgs) Handles MyBase.Paint
Me.TransparencyKey = Color.Green
e.Graphics.FillRectangle(Brushes.Green, Me.ClientRectangle)
End Sub
Ken
-------------------------------
I have put the following in my Form1_Load event:
Dim Img As Bitmap = New Bitmap(1, 1)
Img.SetPixel(0, 0, Color.Green)
BackgroundImage = Img
TransparencyKey = Img.GetPixel(0, 0)
This makes the background green. It should make the background transparent.
If you comment out the second line, it actually works properly. However, I
need the image to be green.
Any ideas?
Matthew
Matthew - 18 Oct 2004 04:27 GMT
> Me.TransparencyKey = Color.Green
> e.Graphics.FillRectangle(Brushes.Green, Me.ClientRectangle)
That's perfect.
Thanks Ken!
Matthew