private static void OnKeyDown(this ScrollableControl control, KeyEventArgs e) { if (!control.ContainsFocus) { return; } if (e.KeyCode == Keys.PageUp) { control.PageUp(); } if (e.KeyCode == Keys.PageDown) { control.PageDown(); } if (e.KeyCode == Keys.Up) { control.ScrollUp(); } if (e.KeyCode == Keys.Down) { control.ScrollDown(); } }