c# - Transfering information between forms -


i've been working on project hour , got stuck. i've got 4 forms last 3 relevant. in form 2 use:

    this.visible = false;     form3 form3 = new form3();     form3.show(); 

to create , show form 3. form3 got textbox empty , want transfer info label in form4. in form 3 use same cod in form 2 make form 3.

i've tried couple of things , searched on forums nothing seems work...

     lbln2.text = form3.txtf.text; 

i want transfer text user writes in textbox(txtf) in form3 empty label(lbln2) in form4.

help appreciated!

try (code in form3 class):

    form4 frm4 = new form4();     frm4.lbln2.text = this.txtf.text; frm4.show(); 

alternative modify constructor method in form4 accept string parameter , invoke follows:

 form4 frm4 = new form4(this.txtf.text);     frm4.show(); 

Comments

Popular posts from this blog

linux - xterm copying to CLIPBOARD using copy-selection causes automatic updating of CLIPBOARD upon mouse selection -

c++ - qgraphicsview horizontal scrolling always has a vertical delta -