Geo*_*off 29
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
Run Code Online (Sandbox Code Playgroud)
这允许您基于图像创建表单,并使用透明度索引使其看起来好像表单不是矩形.
@Geoff在winforms中展示了正确的方式.
但是如果您计划使用WPF而不是Winforms,那么WPF(.NET3.0 +)提供了非常灵活的方法来创建anyshape自定义窗口.查看本文也是http://www.codeproject.com/KB/WPF/wpfpopup.aspx