fork download
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Threading.Tasks;
  9. using System.Windows.Forms;
  10.  
  11. namespace WindowsFormsApplication1
  12. {
  13. public partial class ClassA : Form
  14. {
  15. private ClassB B = new ClassB();
  16.  
  17. public ClassA()
  18. {
  19. InitializeComponent();
  20. button1.Click += (s, e) => B.button1_Click_1(s, e);
  21. // button1.Click += (s, e) => B.button1_Click_2((Button)s, "hogehoge");
  22. }
  23. }
  24.  
  25. public class ClassB
  26. {
  27. public void button1_Click_1(object sender, EventArgs e)
  28. {
  29. (Button)sender.Text = "hogehoge";
  30. }
  31.  
  32. public void button1_Click_2(Button button, string arg /* arg2,arg3... */)
  33. {
  34. button.Text = arg;
  35. }
  36. }
  37. }
Not running #stdin #stdout 0s 0KB
stdin
Standard input is empty
stdout
Standard output is empty