public void Click(int x, int y) { Console.WriteLine($"Click button on {x},{y}"); ClickEventArgs args = new ClickEventArgs() { X = x, Y = y }; //触发onClick事件 OnClick(this, args); }
public void Click(int x, int y) { //触发Click事件 ClickEventArgs args = new ClickEventArgs() { X = x, Y = y }; OnClick(this, args); }
void Btn_OnClick2(object sender, ClickEventArgs args) { Console.WriteLine("Hello,World!"); }
void Btn_OnClick(object sender, ClickEventArgs args) { Console.WriteLine($"Button被点击了!"); }
static void Btn_OnClick(object sender, ClickEventArgs args) { Console.WriteLine($"Button被点击了,X={args.X},Y={args.Y}."); }