简体   繁体   English

Windows窗体C#中的透明度

[英]transparency in windows forms C#

if the transparentkey property is used to make the top level form transparent,it works , but it also makes the main form click-throughable. 如果使用transparentkey属性使顶层表单透明,则可以使用,但也可以使主表单可点击。 I want the opposite of this, that the form becomes transparent, but is still able to recieve clicks. 我要相反的是,表单变得透明,但仍然可以接收点击。 can this be done ? 能做到吗?

Here is een solution. 是解决方案。 The form is totaly transparent and still clickable. 表单是完全透明的,仍然可以单击。

There is also 也有

myform.Opacity = .75

.. which you can change as required. ..您可以根据需要进行更改。 It may work better depending on your needs - you don't state whether its the whole form or only part of it you want transparent. 根据您的需要,它可能会更好地工作-您不需要说明是整个表单还是只是透明表单的一部分。 Also, from MSDN on TransparencyKey : 另外,从MSDNTransparencyKey

Any mouse actions, such as the click of the mouse, that are performed on the transparent areas of the form will be transferred to the windows below the transparent area. 在窗体的透明区域上执行的任何鼠标操作,例如单击鼠标,都将被转移到透明区域下方的窗口中。

.. so it would seem that wont help you at all. ..这样看来对您完全没有帮助。

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

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