function
This commit is contained in:
@@ -33,9 +33,23 @@ namespace CarManagerV2
|
||||
{
|
||||
InitializeComponent();
|
||||
this.Cursor = Cursors.Hand;
|
||||
|
||||
foreach (Control ctrl in this.Controls)
|
||||
{
|
||||
ctrl.Click += ForwardClick;
|
||||
foreach (Control inner in ctrl.Controls) // In case you have nested controls
|
||||
inner.Click += ForwardClick;
|
||||
}
|
||||
|
||||
this.Click += (s, e) => this.OnCardClicked();
|
||||
}
|
||||
|
||||
private void ForwardClick(object sender, EventArgs e)
|
||||
{
|
||||
// Raise your CardClicked event no matter what got clicked
|
||||
CardClicked?.Invoke(this, EventArgs.Empty);
|
||||
}
|
||||
|
||||
public event EventHandler CardClicked;
|
||||
private void OnCardClicked()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user