How can I get the ApplicationContext within a main form?

Presumably if you're creating your application context you must be storing it somewhere, in which case you can pass it to your main form as it is created so it has a reference to it too.
 
Hmm, ApplicationContext takes my main form as constructor parameter:

static void Main()
{
MyContext _MyCtx = new MyContext(new MyForm());
Application.Run(_MyCtx);
}

where MyContext derives from System.Windows.Forms.ApplicationContext,
so I've looked for some kind of standard way (parameter) to get the context within a form (something like that: myForm.Context, like in ASP.Net that has it's HttpContext).
 
Back
Top