Tnx for the fast response,
however, still missing the point.
Based on a topic @
http://msdn.microsoft.com/library/d...wlkcodegettingvaluefromanotherformvisualc.asp
I created a Form1 with a readonly textBox1 and a button to open Form2.
Form2 contains a textBox1 to insert something and a button to close
Form2.
The code for Form1:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace Form1toForm2
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
Form2 getForm2 = new Form2();
getForm2.ShowDialog();
}
public TextBox TextBox1
{
get
{
return textBox1;
}
}
}
}
and the Code for Form2:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace Form1toForm2
{
public partial class Form2 : Form
{
public Form2()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
Close();
}
private Form1 otherForm;
private void GetOtherFormTextBox()
{
textBox1.Text = otherForm.TextBox1.Text;
}
}
}
The code above is not working because an event is missing to copy
Form2 textBox text to Form1 textBox
So, what is needed?
TIA,
Greetings,
John