V
VMI
In my Windows application, the main Form (Form_Main) calls a small Form
(Form_X) that checks a file. Basically, I pass the name of the file through
frmX's constructor and then I display it with ShowDialog(). In the
constructor, I call the method that runs the validation process. Is it
possible that, once this process (which returns a bool) is finished, that it
returns this value to the main Window ? Baically, I want to pass the return
value of checkRecordsLength() to Form_Main without having to add any
variables or references.
So, from Form_Main, I instantiate frmX:
Form_X frmX= new Form_X(sFileName);
frmCheck.ShowDialog();
---------------------------
In my Form_X:
public Form_X(string sFileName, ref bool isValid)
{
InitializeComponent();
_sFileName = sFileName;
checkRecordsLength();
}
private bool checkRecordsLength()
{
/* validate _sFileName *./
if (fileIsValid)
return true;
else
return false;
}
Thanks.
(Form_X) that checks a file. Basically, I pass the name of the file through
frmX's constructor and then I display it with ShowDialog(). In the
constructor, I call the method that runs the validation process. Is it
possible that, once this process (which returns a bool) is finished, that it
returns this value to the main Window ? Baically, I want to pass the return
value of checkRecordsLength() to Form_Main without having to add any
variables or references.
So, from Form_Main, I instantiate frmX:
Form_X frmX= new Form_X(sFileName);
frmCheck.ShowDialog();
---------------------------
In my Form_X:
public Form_X(string sFileName, ref bool isValid)
{
InitializeComponent();
_sFileName = sFileName;
checkRecordsLength();
}
private bool checkRecordsLength()
{
/* validate _sFileName *./
if (fileIsValid)
return true;
else
return false;
}
Thanks.