意外的透明度而不是白色

时间:2017-03-20 21:19:51

标签: c# winforms visual-studio

我正在开发一个GUI,并且它无缘无故地显示透明度而不是图像本身的白色,这可能是什么原因造成的?

执行申请前的原始GUI:

Original GUI before executing application

执行申请时:

Upon Executing the Application

1 个答案:

答案 0 :(得分:3)

要解决此问题,请将TransparencyKey重置为其默认值,或删除分配:

this.TransparencyKey = Color.Empty;

而不是

this.TransparencyKey = Color.Transparent;

参考文献:https://stackoverflow.com/a/13426429/1132334documentation

  

当为TransparencyKey属性指定一个Color时,具有相同BackColor的表单区域将以透明方式显示