There are a couple of ways:
1. Create a bitmap in the shape of the form with a background color that is not part of the bitmap, such as magenta. Then set the TransparencyKey Property of the form to match the background color of the bitmap. All pixels of the bitmap with the TransparencyKey color will be transparent.
2. Create a GraphicsPath object and use it's various methods (AddEllipse, AddLine, AddArc, etc) to create the shape you want. Then create a Region object using that GraphicsPath. Finally, set the Form.Region property to the region you created.
Source path: http://forums.microsoft.com/MSDN/ShowPost.aspx?Pos...
本文介绍两种实现窗体透明与自定义形状的方法:一是通过创建位图并设置窗体的透明键属性;二是利用GraphicsPath和Region对象来定义窗体的形状。
2698

被折叠的 条评论
为什么被折叠?



