Changing Application Context

  • Thread starter Thread starter John H via .NET 247
  • Start date Start date
J

John H via .NET 247

Hey All,

I'm using application.run(context) to open the main screen of myapplication. What I would like to is based on a menu choice,close the main screen and open a new one. I can't close themain screen though since that will close the application sinceit is defined as the context. How can I change the context ofthe application? If I can't how can I accomplish this?

Thanks,
John
 
Hi John,

Use the overload of the Application.Run method that accepts
ApplicationContext object. In this way you're going to have more control
when the application closes.
Refer to the example for this overload in MSDN it will give you enough clue
how to do this.

--
HTH
Stoitcho Goutsev (100) [C# MVP]


Hey All,

I'm using application.run(context) to open the main screen of my
application. What I would like to is based on a menu choice, close the main
screen and open a new one. I can't close the main screen though since that
will close the application since it is defined as the context. How can I
change the context of the application? If I can't how can I accomplish
this?

Thanks,
John
 
Start the new application in a new domain.
The default app domain will host only a form through which the screens can
be loaded.

HTH :)

Hey All,

I'm using application.run(context) to open the main screen of my
application. What I would like to is based on a menu choice, close the main
screen and open a new one. I can't close the main screen though since that
will close the application since it is defined as the context. How can I
change the context of the application? If I can't how can I accomplish
this?

Thanks,
John
 
Back
Top