You need to dynamically traverse through all the controls in the form and add the MouseClick event handler.
Please check this answer: Handling a Click for all controls on a Form
Below code adds MouseClick event handler to the first level of controls:
foreach (Control c in this.Controls)
{
c.MouseClick += new MouseEventHandler(
delegate(object sender, MouseEventArgs e)
{
// handle the click here
});
}
But if your controls have clild controld then you will have to recursively add the eventhandler:
void initControlsRecursive(ControlCollection coll)
{
foreach (Control c in coll)
{
c.MouseClick += (sender, e) => {/* handle the click here */});
initControlsRecursive(c.Controls);
}
}
/* ... */
initControlsRecursive(Form.Controls);