Click though transparent area of button?

2 posts, 0 answers
  1. Andrew
    Andrew avatar
    2 posts
    Member since:
    Jul 2013

    Posted 06 May Link to this post

    How do I allow the mouse click to pass thorough this control transparent area to any controls behind it?

     

  2. Hristo
    Admin
    Hristo avatar
    716 posts

    Posted 09 May Link to this post

    Hello Bryan,

    Thank you for writing.

    Each control is responsible for handling its own events no matter if it is transparent or not. A possible solution would be to create a custom button and override its WndProc method and listen for the WM_NCHITTEST message. Then you can modify it and make your control transparent for all mouse events.

    If you do this you would be able to handle the click event with whatever control lies under your button. Please check the following forum thread discussing a similar scenario: http://stackoverflow.com/questions/547172/pass-through-mouse-events-to-parent-control#8635626.

    I hope this helps. Should you have further questions please do not hesitate to write back.

    Regards,
    Hristo Merdjanov
    Telerik
    Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
  3. UI for WinForms is Visual Studio 2017 Ready
Back to Top