简体   繁体   English

如何在不更改文本不透明度的情况下更改“窗体”窗口的不透明度

[英]How to change opacity of Form window without changing opacity of text

I'm trying to recreate a Kali-Linux DOS window, just for fun and have my own custom commands in it. 我试图重新创建一个Kali-Linux DOS窗口,只是为了好玩,并在其中拥有自己的自定义命令。

I'm making a form which is a 70% visible form. 我正在制作70%可见形式的表格。 Problem is, I tried putting the opacity of form to 70% but it made it ALL 70% visible instead. 问题是,我尝试将表单的不透明度设置为70%,但改为使所有可见性变为70%。 Putting in a picturebox and changing opacity of it didn't help either since it only shows the application instead of the background of my computer. 放入图片框并更改其不透明度也无济于事,因为它仅显示应用程序而不是计算机的背景。

I know I could have done console application for this, but there is no appearance customization. 我知道我可以为此完成控制台应用程序,但是没有外观定制。

It's simply not possible in WinForms. 在WinForms中根本不可能。 A partially transparent form cannot have opaque controls. 部分透明的窗体不能具有不透明的控件。 Some people might recommend using two forms, one fully transparent with opaque controls over another partially transparent, but I won't go into that. 有人可能会建议使用两种形式,一种是完全透明的,而另一种是部分透明的,但具有不透明的控件,但我不会赘述。

The opacity of the form will change all controls in the form 表单的不透明度将更改表单中的所有控件

Follow Genius Brain alternate example. 遵循Genius Brain替代示例。 That is the only way to achieve partial transparency, and so on. 这是实现部分透明性的唯一方法,等等。

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

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