using System; using System.Collections.Generic; using System.ComponentModel; using System.Drawing; using System.Data; using System.Linq; using System.Text; using System.Windows.Forms; namespace JwKdsV.Component { public partial class LoginKeyboardX : UserControl { public LoginKeyboardX() { InitializeComponent(); } public delegate void EventHandle(object sender, LoginKeyboardEventArgs e); public event EventHandle LoginKeyboardButtonClick; protected virtual void OnButtonClick(LoginKeyboardEventArgs e) { LoginKeyboardButtonClick?.Invoke(this, e); } private void OnKeyClick(object sender, EventArgs e) { var t = sender as TouchButtonX; OnButtonClick(new LoginKeyboardEventArgs(t.KeyCode)); } } public class LoginKeyboardEventArgs : EventArgs { private readonly string _key; public LoginKeyboardEventArgs(string key) { this._key = key; } public string Key { get { return _key; } } } }