October 10th, 2009, 11:32 AM
Clickable area that is transparent/colourless
I've search for hours on Google but could find a solution.
I want a clickable area (that can handle MouseClickEvent, DoubleClickEvent, etc...) that is transparent, hence you can look through it.
I have Form1 with a bunch of buttons, text fields, etc. I want a clickable area that is over the whole Form1 (thus over all the buttons, etc).
If you click this area, the clickEvent for this area should be could and not the eg: button underneath this area.
Most importantly of all the area must be transparent, thus all the buttons, textfields, etc underneath the clickable area should be visible.
Something like a panel or pictureBox that you could put over the buttons would be fine, but a if you drag a panel/pictureBox over a button, the button is invisible, and if you say send to back, the event of the button will be called and not that of the clickable area.
I've attached an image as example.
I want the blue area (in this case a picture box) over ALL the buttons and textboxes, so that if you click this blue area a function should be called. This area should actually not be blue, but transparent/colourless, so that you can see the buttons underneath. If I say send the picturebox behind the buttons, then when I click on a button, the button's function is called and not the picture box's function as I want it.
It is impossible for me to change all the event handlers of the buttons/textboxes etc, because I also use components that don't have the necessary event handlers that I want. So this is the only possible method I can think of.
Thank you for any help or suggestions.
October 13th, 2009, 06:19 AM
Re: Clickable area that is transparent/colourless
This won't be possible ( IMHO, and AFAIK ), it just doesn't make sense in any case that it would be possible to have an invisible overlay over a window that is manipulatable. Rather rethink your strategy. If you want all your controls ( and the form ) to share common event handlers, work from the Form upwards, as that is the main object, and do all manipulation through the form. It will take a lot of APIs to achieve that, but, in theory it is possible, but why on earth would you need something like this ¿
This is the first time I hear such a request.
Tags for this Thread
Click Here to Expand Forum to Full Width
This is a Codeguru.com survey!