现在的位置: 首页 > 综合 > 正文

Change the shape of a form

2019年10月06日 ⁄ 综合 ⁄ 共 538字 ⁄ 字号 评论关闭

 

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...

抱歉!评论已关闭.