"ba*******************@gmail.com" wrote:
I'm trying to implement custom button. But I don't want to extend
Button class.
I want to extend Control class.
I want to implement Enable disable functionality.
But unfortunatly when control is in Enable = false state the on click
event is not called but that event is passed to parent object.
How to convince my custom button class not to pass Click events to
parent classes when my class is in Disabled state?
Unfortunately, if the Button is disabled, it will not receive mouse events,
which means events pass on to the button's parent control.
Off the top of my head, I can think of two options, both a little tricky:
1. Create a transparent control and place it over your disabled control.
Then monitor for mouse events in your transparent control. Here's how to
make controls transparent:
http://www.c-sharpcorner.com/Code/20...ntControls.asp
2. Monitor for the mouse clicks in your parent control, then pass them to
your custom button.
--
Timm Martin
Mini-Tools
..NET Components and Windows Software
http://www.mini-tools.com