Hi All,
I am very happy in this c-sharpcorner. I was never thinking to get so fastly and exact answers, thanx to you all.
I am able to sent String Datas between forms, but I'm not able to Call datas between Forms,
How does it work if I want to call a Data from any open Form ?
any helpfull links or codes?
thank you

VulpesPosted Aug 21, 2012, 8:50 AM
You then need to get a reference to the form it's on. There are many ways to do this but one which always works is to use the Application.OpenForms property. For example, if you wanted to access textBox1 which was on Form1 (Name property also "Form1") you could do this:
Form1 f1 = (Form1)Application.OpenForms["Form1"];
string text = f1.textBox1.Text;
If the data is not within a control, then you need to place a public (or internal) property or method on the form to access it. For example:
// on Form1
internal string GetText()
{
return "something";
}
// on some other form
Form1 f1 = (Form1)Application.OpenForms["Form1"];
string text = f1.GetText();