Pass between two forms

xiaoxiao2021-03-06  83

Form1 placed a label1, a button1, form1 is the main window, when clicking Button1, execute: form2 f2 = new form2 (); f2.Showdialog (this);

Form2 places a TextBox1, a Button1, execute when clicking Button1:

Form1 f1 = (form1) this.owner; f1.label1.text = this.TextBox1.text;

Note: Label1 in Form1 is set to public

转载请注明原文地址:https://www.9cbs.com/read-121962.html

New Post(0)