Hi,
How can transfer a text of textbox from a C# form to another C# form?
thanks
Loading
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
omid9 reputationPosted Jul 28, 2009, 12:24 PM EDT
in Form2 :
in Form1 you can use this way to retrieve textbox val using getTextBoxVal() function :
bharat9 reputationPosted Jul 25, 2009, 1:51 AM EDT
shima32 reputationPosted Jul 25, 2009, 8:08 PM EDT
How can use static class for this problem?!
Please say an example...
Niradhip ChakrabortyRank #429 · 5.8K reputationPosted Jul 28, 2009, 2:08 AM EDT
form2.Controls["textBox1"].Text = this.textBox1.Text;
this.Close();
bharat9 reputationPosted Jul 28, 2009, 3:46 AM EDT
public static class abc
{
public static string a;
}
abc.a=TextBox1.text;
in form2
using abc.a gives u the text in textbox
use access modifiers according to ur need
shima32 reputationPosted Jul 28, 2009, 7:50 PM EDT