Пример #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();
        }
Пример #3
0
        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; // <-- go to "modifiers" in the properties to enable the final form to be public; VS2013 does not have it.

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

            // hides the form
            this.Hide();
        }
Пример #4
0
        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();
        }