Beispiel #1
0
 private void NextButton_Click(object sender, EventArgs e)
 {
     //instantiate an object to the next form - (final form)
     FinalForm finalform = new FinalForm();
     //pass reference from the current form to the final form
     finalform.ListForm = this;
     //pass the selected data to the final form
     finalform.ProvinceTextBox.Text = this.ProvinceTextBox.Text;
     //Show the next form
     finalform.Show();
     //Hide this form
     this.Hide();
 }
        private void NextButton_Click(object sender, EventArgs e)
        {
            // Instantiate an object of the next form - in this case the Final Form
            FinalForm finalForm = new FinalForm();
            // pass a reference to the current form (this) to the a public property of the next form
            finalForm.listForm = this;
            // pass some data
            finalForm.ProvinceTextBox.Text = this.ProvinceTextBox.Text;

            // show the next form
            finalForm.Show();

            // hide this form
            this.Hide();
        }