且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

透明的Windows窗体可以处理点击

更新时间:2023-12-06 12:50:16

如果我正确地理解你的问题,你可以使用的 TrancparencyKey

If I understand your question correctly, you can Use TrancparencyKey

设置 TrancparencyKey 背景色属性都以相同的颜色像 Col​​or.Red

Set TrancparencyKey and BackColor properties both to same color like Color.Red.

下面是透明的屏幕截图在表格的Visual Studio:

Here is the screenshot of transparent form over visual studio:

透明的Windows窗体可以处理点击

请注意:


  • 当你使用例如 Col​​or.Red 每一件事工作正常,你可以处理鼠标点击。但是,行为是不同的颜色不同,例如 Col​​or.Magenta ​​ code>的形式不能捕获鼠标点击

  • When you use for example Color.Red every thing works fine and you can handle mouse Click. But the behavior is different for different colors, for example Color.Magenta the form can not capture the mouse Click.