如何禁用透明控件上的点击? [英] How to disable click through on transparent control?

查看:133
本文介绍了如何禁用透明控件上的点击?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们的应用程序中有一个需要Google Earth背景图像的映射表单,并且由于您无法在面板下方的浏览器中使用Google Earth插件,因此我们使用第二种表单来显示背景图像.我们在映射表单上有一个透明面板,可以在上面绘制图形,而在下面同步保存的表单上绘制Google Earth时.

We have a mapping form in our application that needs a Google Earth background image, and as you can't use the Google Earth plugin in a browser that is under a panel, we use a second form to show the background image. We have a transparent panel on the mapping form that the drawing is done on while Google Earth is drawn on a form held in sync below.

我们通过提供透明键255, 250, 250并在绘制之前将面板背景设置为此颜色来实现透明.尽管现在在查看在线可用信息之后,似乎该面板永远不会收到光标事件.

We achieve transparency by giving the form a transparency key of 255, 250, 250 and setting the panel background to this color before drawing on it. Although now after looking at the information available online it appears that the panel shouldn't ever get cursor events.

这在大多数情况下都可以正常工作,但是在一台或两台客户计算机(一台肯定是Windows 7)上,光标在透明的面板上将无法正常工作.如果将光标放在地图的绘制区域上,则一切正常.

This works perfectly in most cases, but on one or two customers machines (one is definatly Windows 7) the cursor will not work correctly on the panel where it is transparent. If the cursor is placed over a drawn area of the map then it all work fine.

我认为该问题是由于透明点击所导致的,但由于在大多数情况下都可以正常运行,因此我不确定到底发生了什么.我们已经更新了所有图形驱动程序,以查看客户计算机上是否有自定义设置,但这无济于事.

I think the issue is due to transparancy click through but as it works in most cases I'm not sure what is exactly going on. We've updated all of the graphics drivers to see if there is a custom setting on the customers machine but this hasn't helped.

有人对透明键的功能有明确的描述吗?有没有一种方法可以绝对设置面板应该接收鼠标事件?

Does someone have a definative description of what the transparency key does? Is there a way to absolutly set that the panel should recieve the mouse events?

编辑
添加了有关透明键的详细信息.

EDIT
Added detail about transparency key.

推荐答案

Stevo-您是否找到答案了?我遇到了同样的问题,并想出了将主窗体的透明度键更改为某种奇怪颜色的方法.可能会或可能不会帮助您.我有一个具有透明度的自定义控件,但是表单键颜色也是我的绘图颜色,因此允许它(奇怪地)单击.我更改了它,然后开始工作了!

Stevo - Have you ever figured out an answer to this? I had the same problem and figured out to change the transparency key of the main form to some odd color. May or may not help you. I had a custom control with transparency but the forms key color was also my drawing color, thus allowing it to click through (strangely). I changed it and it worked!

这篇关于如何禁用透明控件上的点击?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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