This is a migrated thread and some comments may be shown as answers.

Click though transparent area of button?

1 Answer 62 Views
Buttons, RadioButton, CheckBox, etc
This is a migrated thread and some comments may be shown as answers.
Andrew
Top achievements
Rank 1
Andrew asked on 06 May 2016, 12:49 PM

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

 

1 Answer, 1 is accepted

Sort by
0
Hristo
Telerik team
answered on 09 May 2016, 01:48 PM
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.
Tags
Buttons, RadioButton, CheckBox, etc
Asked by
Andrew
Top achievements
Rank 1
Answers by
Hristo
Telerik team
Share this question
or