C#的WinForms透明控制允许的点击 [英] C# Winforms Transparent Control allowing Clickthrough

查看:192
本文介绍了C#的WinForms透明控制允许的点击的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个问题,有些涉及到:
的http:/ /stackoverflow.com/questions/855826/c-winforms-transparent-control-allowing-clickthrough

I have a problem, a bit related to: http://stackoverflow.com/questions/855826/c-winforms-transparent-control-allowing-clickthrough

出乎他,我想捕捉mouseevents我程序,同时仍保留一个窗口什么我的计划背后。
color.transparent不工作,并transparencykey只是提供鼠标事件无论是下方。
使用透明背景色或等于transparencykey没有得到期望的效果的背景色面板

Contrary to him i would like to capture mouseevents on my program, while still retaining a "window" to whats behind my program. color.transparent doesnt work, and transparencykey just delivers mouse events to whatever is underneath. Using a panel with transparent backcolor or with a backcolor equal to transparencykey does not give the desired effect.

PLZ帮我:)

推荐答案

如果您需要捕获鼠标事件,这是包括鼠标点击,然后只需使用透明度,但不要将其设置为 0 设置为 1

If you need to capture the mouse events, and that's include the MouseClick, then simply use transparency, but don't set it to 0 set it to 1.

这将是足够透明识破,但因为它是非零的鼠标事件将要处理的最前端窗口。

It will be transparent enough to see through, but because it's non-zero the mouse events will be processed the the front-most window.

这篇关于C#的WinForms透明控制允许的点击的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆