draj
June 11th, 2003, 02:16 PM
In the main() function
I have written the following code.
void main()
{
Form2 testDialog = new Form2();
if (testDialog.ShowDialog() == DialogResult.OK)
{
// Read the contents of testDialog's TextBox.
result.Text = testDialog.TextBox1.Text;
}
else
{
result.Text = "Cancelled";
}
testDialog.Dispose();
Global.frmMain = New frmMain() ;
Global.frmMain.ShowDialog();
}
I get the form load event for the first form testDialog.
But I don't get the form load event for the form frmMain.
But if I use form.Show() instead of form.ShowDialog() Load event gets triggered but the Application shuts down since main() exits.
Anybody know how to resolve this issue?
Thanks,
Raj
I have written the following code.
void main()
{
Form2 testDialog = new Form2();
if (testDialog.ShowDialog() == DialogResult.OK)
{
// Read the contents of testDialog's TextBox.
result.Text = testDialog.TextBox1.Text;
}
else
{
result.Text = "Cancelled";
}
testDialog.Dispose();
Global.frmMain = New frmMain() ;
Global.frmMain.ShowDialog();
}
I get the form load event for the first form testDialog.
But I don't get the form load event for the form frmMain.
But if I use form.Show() instead of form.ShowDialog() Load event gets triggered but the Application shuts down since main() exits.
Anybody know how to resolve this issue?
Thanks,
Raj