Changing Application Context

  • Thread starter John H via .NET 247
  • 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
 
S

Stoitcho Goutsev \(100\) [C# MVP]

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
 
A

Alok

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top