Forms Transparency not working in .NET2

Hi all
I am trying to do a non rectangular shaped form.

I have done it in 2003 and worked fine but doesnt work properly in VS2005.

I have a bitmap image and set the forms background image to it.
I then call the set transparency in code to get round the bug for 32bit color monitors.

The background color from my bitmap is removed correctly but i see the background of the form instead.  Any idea what i am doing wrong

Is there a new way of doing it in .NET 2

Here is my SetTransparency method for the form:


protected void SetTransparency()
{

    Bitmap Img = (Bitmap)this.BackgroundImage;

    if (Img != null)
    {
       //Needed as bug in transparency when comp is using 32bit color display
       //The color at Pixel(10,10) is rendered as transparent for the complete background.

       Img.MakeTransparent(Img.GetPixel(10, 10));
       this.BackgroundImage = Img;
       this.TransparencyKey = Img.GetPixel(10, 10);
    }
}


 



Answer this question

Forms Transparency not working in .NET2