tags:

views:

1868

answers:

4

Hi,

What is the easiest way to do this? Is it possible with managed code?

Thanks for your time.

+16  A: 
this.BackgroundImage = //Image
this.FormBorderStyle = FormBorderStyle.None;
this.Width = this.BackgroundImage.Width;
this.Height = this.BackgroundImage.Height;
this.TransparencyKey = Color.FromArgb(0, 255, 0); //Contrast Color

From http://vckicks.110mb.com/custom_shape_form_transperancy.html

This allows you to create a form based on an image, and use transparency index to make it seem as though the form is not rectangular.

Geoff
Doesn't seems to be working with VS2005 (.Net 2.0)
Matías
My bad, now it's working. Thanks.
Matías
Unfortunately, this doesn't work if the Opacity of the form is set to anything other than 100% (apparently .NET applies the opacity effect and then the transparancy mask).
MusiGenesis
Well, it does work, but you have to figure out what the transparency color will be after the opacity effect.
MusiGenesis
+6  A: 

@Geoff shows the right way in winforms.

But If you are planning to use WPF instead of Winforms then WPF(.NET3.0+) gives very flexible ways to create anyshape custom windows. Check out this article also http://www.codeproject.com/KB/WPF/wpfpopup.aspx

Jobi Joy