When the child form is displayed in the parent form, add the child form. owner = this; define a parent form object in the child form, and set the parent form object = (parent form type) this in the Load function. owner. Then, use this parent form object to directly use its parameters at any position in the child form (these parameters must be defined as public ). define the parent form object as a variable of the child form. Instead of defining the parent form object in Load, you only get the parent window in Load, in this way, the parent window object can be used at any position of the child form, as shown in the following code: (1) Form2 f2 = new Form2 () in the parent form (); // create a subform object
F2.Owner = this;
// Set the owner of the subform object to Form1 (2) in the subform private void Form2_Load (object sender,
EventArgs e) // you must call
{
Form1 f1 = (Form1) this. Owner;
// Call the parent form in this way
TextBox4.Text = f1.hight. ToString ();
}