There are so many methods to pass data between forms in windows
application. let me take four important (easiest) ways of accomplishing this.
1.Using Constructor
2.Using Objects
3.Using Properties
4.Using Delegates
Constructor approach:
Step 1: Code a constructor for Form2 class as below
Public Form2(string strTextBox)
{
InitializeComponent();
label1.Text = strTextBox;
}
Step 2: Instantiate Form2 class in Form1 button click event as below
Private void button_Click(object sender System.EventArgs e)
{
Form2 frm = new Form2(textbox1.Text);
Frm.Show();