public
partial
class
Form1 : Form
{
public
Form1()
{
InitializeComponent();
}
private
void
button1_Click(
object
sender, EventArgs e)
{
using
(Form2 frm =
new
Form2())
{
if
(frm.ShowDialog() == DialogResult.OK)
{
int
[] i = frm.RetValue;
Console.WriteLine(i.ToString());
}
}
}
}
public
Form2()
{
InitializeComponent();
this
.DialogResult = DialogResult.Cancel;
}
public
int
[] RetValue ={ 1, 2, 3 };
private
void
button1_Click(
object
sender, EventArgs e)
{
this
.DialogResult = DialogResult.OK;
}