I have two forms, in form1 I have a textfield name file1 that I input any info, than on form2 I have another textfield name file2. What i want to do is that when I press my comand botton it gets the value of textfiled1 and puts it into textfield of form2?
plz help

One way is to modify the constructor for Form2 to contain a string parameter, so when it is instantiated, it will receive the string.

static void Main()
{
   Application.EnableVisualStyles();
   Application.SetCompatibleTextRenderingDefault(false);
   Application.Run(new Form1());
   Application.Run(new Form2(Form1.strTransfer)); // <<<---
}
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.