日期:2014-05-18  浏览次数:20726 次

C#2005 请问MDI窗体能不能实现自定义标题栏效果
我在单窗体上已经可以实现了,首先把form的frmBorderstyle =None ,然后做一个位图,再设置需要透明的地方
可以改成mdi窗体就没有办法实现透明了,就是说我想让窗体的某些地方透明就不行了
请问有办法实现透明吗?

------解决方案--------------------
设置Region属性来指定窗体的显示区域就可以了,不必也最好不用透明色来处理。比如:
如下的代码设置窗体的显示形状:

C# code
        public frmPrintExcel()
        {
            InitializeComponent();

            GraphicsPath path = new GraphicsPath();
            path.AddEllipse(0, 0, this.ClientRectangle.Width, this.ClientRectangle.Height / 2);
            path.AddEllipse(0, this.ClientRectangle.Height/2, this.ClientRectangle.Width, this.ClientRectangle.Height / 2);
            this.Region = new Region(path);
        }

------解决方案--------------------
重绘标题栏了,就是比较麻烦了

这方面的C++例子很多了,