private void mouseDown(object sender, MouseEventArgs e) { Focus(); if (e.Button == MouseButtons.Left) { PressDown?.Invoke(this, EventArgs.Empty); } }
private void keyDown(object sender, KeyEventArgs e) { switch (e.KeyData) { case Keys.Enter: case Keys.Space: PressDown?.Invoke(this, EventArgs.Empty); onPressed(); break; } }
public void Down() { PressDown?.Invoke(); }