日新阁

取日三省之意,记生活珠玑,每日清新,谓日新阁.

 

c# 制作不规则窗体

制作不规则窗体  有两种方式:
 
1、使用Windows Forms 的transparency key属性。
2、GUI+ 技术。

使用Windows Forms 的transparency key属性


set the FormBorderStyle property to None (which will remove the borders).
create a bitmap that will be set as the background image for your from.
fill the area that you want it to appear transparent with a specific color (e.g.: black).
set the BackgroundImage property to your bitmap.
set the TransparencyKey property to the specified color (black, for our example).

GUI+ 技术

set the FormBorderStyle to None
set the BackColor property with a specified color
set the TransparancyKey property with the same color
now the whole form is transparent
then use the GraphicsPath class to specify the visible region of your form
then call the SetClip method to replace the clipping region with the GraphicsPath region
fill the region with a color or an image

posted on 2007-06-28 13:55  flashicp  阅读(472)  评论(0编辑  收藏  举报

导航