Answer the question
In order to leave comments, you need to log in
How to disable child control events in WinForms?
I have a UserControl that has one Label and one PictureBox. After adding this control to the form, the OnClick events on it are processed only if I clicked on the place in the control where my other elements (Label and PictureBox) are not located. To solve this problem and bind all the events of the elements located on the control to the control itself, I call the same events of my control from the child event handlers. Because of this, I have confusing code in places, and in principle, this greatly increases its number. Is it possible to somehow make it so that with the same click on the control, wherever the cursor is, it would process the event of my control, and not those elements in it on which the cursor is located?
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question