I have a c# form (let’s call it MainForm) with a number of custom controls on it. I’d like to have the MainForm.OnClick() method fire anytime someone clicks on the form regardless of whether the click happened on the form or if the click was on one of the custom controls. I’m looking for behavior similar to the KeyPreview feature of forms except for mouse clicks rather than key presses.
Share
In the form’s ControlAdded event, add a MouseClick handler to the control, with the Address of the form’s click event. I haven’t tested this, but it might work.