Clickable area that is transparent/colourless
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2

Thread: Clickable area that is transparent/colourless

  1. #1
    Join Date
    Oct 2009
    Posts
    1

    Red face 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.
    For example:
    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.
    Attached Images Attached Images  

  2. #2
    Join Date
    Jul 2001
    Location
    Sunny South Africa
    Posts
    11,091

    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center