start with differen screen

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi Guys.

when my application starts, it will check some connection information.
if information does not exist, it will pops up a dialog to let user input
connection information.
after user input information and click Ok, it will to return main screen.

if information is there, it will directly go to main screen.

So,
In the main Entry:

I have wroten source like this:

if (_info == null)
{
Application.Run(new InfoDialog());
}
Application.Run(_mainScreen);

however,the issue is
it pops up InfoDialog, but when I push OK button on InfoDialog.
It go to next step: Application.Run(_mainScreen);

but it does not stop.

what is the problem?
Thanks.
 
First option, change your project to startup from a class rather than
a form, and in that class create/show the dialog form if required then
continue to create/show the main form.

OR, do the application.run(mainform) and in it's load event create/
show the info dialog if required.

Trying to call application.run twice ain't going to work.

Chris
 
The problem is you are running to different application threads.

Try rethinking your design. Maybe have _mainScreen determine if the
information is there or not. If its not there then have it display the
InfoDialog after creation.

I personally try to stay away from multiple forms in a single program,
thus I use panels instead. In this case, my main form would determine
if the information was there. If it isn't, then it would show a Modal
dialog that asks for the information. After themain form is happy that
the information is present, it would display the correct panels.

This is just one of many solutions.

I hope this helps,
 
Hi Guys.

Thanks for your help.
And also, you give me a clear outline about NET start clue.

I have made it by you guys suggestion.

I used dot net 2 weeks ago.sorry about my stupid question.

Thanks again.
 
Back
Top