Using system;using system.collections.generic;using system.componentmodel;using system.data;using System.Drawing; Using system.linq;using system.text;using system.windows.forms;namespace windowsformsapplication1{public delegate void ces (string a); public partial class Form2:form { ces bbb; Public Form2 (CES aax) { bbb = Aax; InitializeComponent (); } private void Button1_Click (object sender, EventArgs e) { bbb (this.textBox1.Text); } }
Using system;using system.collections.generic;using system.componentmodel;using system.data;using System.Drawing; Using system.linq;using system.text;using system.windows.forms;namespace windowsformsapplication1{public Partial class Form1:form { private string text; Public Form1 () { InitializeComponent (); } Public Form1 (string text) { //todo:complete member initialization this.text = text; } private void Button1_Click (object sender, EventArgs e) { Form2 f = new Form2 (setmsg); F.showdialog (); } private void Form1_Load (object sender, EventArgs e) { } public void Setmsg (String msg) { This.label1.Text = msg;}}}
C # Form Transfer log