如何使WinForm的窗口透明,画面中可见?画面、透明、窗口、WinForm

2023-09-04 01:27:43 作者:誰是我的菜

我有一个想法,在winform设计的窗口。如下图所示。我尝试了窗口透明度礼。

I have a idea for designed window in winform. like below. I try the window opacity propriety.

但是图像也不可见的。如何让这个在winform。

But the Image also not visible. How to make this in winform.

我发现这个形象在谷歌。谢谢你。

I found this image in google. Thanks.

推荐答案

尝试使用的 Form.TransparencyKey 财产

请确保您使用的背景图片有一定的色差,并设置这个颜色为TransparencyKey。

Make sure the background of the picture you use have the a certain color and set this color as the TransparencyKey.

您也应该设置 FormBorderStyle 属性FormBorderStyle.None为了隐藏窗体的标题,边框等:

You should also set the FormBorderStyle property to FormBorderStyle.None in order hide the form's title, border, etc: