简体   繁体   English

如何使MDIChild透明?

[英]How to make MDIChild Transparent?

I'd successfully made a normal Form Transparent by handling the OPACITY property. 通过处理OPACITY属性,我成功地使常规窗体透明。

Now, I want to make an MDIChild (loaded in an MDIParent) transparent. 现在,我想使MDIChild(加载到MDIParent中)透明。 Is that possible? 那可能吗? I'd applied the same technique (mentioned above) for the MDIChild. 我对MDIChild应用了相同的技术(如上所述)。 But, was unsucessful. 但是,没有成功。

Is it possible to make the MDIChild tranparent. 是否可以使MDIChild透明。 Does anyone had done that before? 有人做过吗?

Any hekp will be appreciated. 任何麻烦将不胜感激。 Thanks. 谢谢。

否。MDI子窗体不支持透明度。

You May try assigning the mdiparent to a form variable, set the mdichild's mdiparent property to null and then apply your technique to make it transparent . 您可以尝试将mdiparent分配给一个表单变量,将mdichild的mdiparent属性设置为null,然后应用您的技术使其透明。 i dont know if it would work 我不知道这是否行得通

You can use Region property. 您可以使用Region属性。

this.Region = this.CreateNewRegion();
// ...
private Region CreateNewRegion() {
   var points = new Point[] { new Point(0,0), new Point(20,0), new Point(30, 50) };
   var path = new System.Drawing.Drawing2D.GraphicPath();
   path.AddPolygon( points );
   var region = new Region( path );
   return region;
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM