, , . . , .
1- ( , ) .
private void ShowForm(int a, string b, double c)
{
Form2 frm = new Form2(a, b, c);
frm.ShowDialog();
}
2- . ( )
private void ShowForm(int a, string b, double c)
{
Form2 frm = new Form2();
frm.intval = a;
frm.strval = b;
frm.doubleval = c;
frm.ShowDialog();
}
3- .
private void ShowForm(int a, string b, double c)
{
Form2 frm = new Form2();
frm.IntValue = a;
frm.StringValue = b;
frm.DoubleValue = c;
frm.ShowDialog();
}
4- .
private void ShowForm(int a, string b, double c)
{
Form2 frm = new Form2();
frm.SomeTextBox.Tag = a;
frm.SomeTextBox2.Tag = b;
frm.SomeTextBox3.Tag = c;
frm.ShowDialog();
}
5- . ( ).
public delegate void PassValues(int a, string b, double c);
public PassValues passVals;
private void PassDataThroughDelegate(int a, string b, double c)
{
if(passVals != null)
passVals(a,b,c);
}
private void ShowForm(int a, string b, double c)
{
Form2 frm = new Form2();
frm.passVals = new Form2.PassValues(UseData);
frm.ShowDialog();
}
private void UseData(int a, string b, double c)
{
}
- , .
, , .
, . , .
Update
( - ). , , :
:
ChangeString , Program.cs. . , , .
:
, OO (Object Oriented) . OO , , . , .Net # , . , Winforms .
, , Program.cs . . , , .
, .