C# - Is it possible to start my project with a class instead of a form?
Posted
by Irro
on Stack Overflow
See other posts from Stack Overflow
or by Irro
Published on 2010-05-15T08:29:17Z
Indexed on
2010/05/15
8:34 UTC
Read the original article
Hit count: 174
I want my project to be started through an class instead of a form, is there any way to do this? Or to be more precise is there any good way to make sure that the first class, except Program, that is started isn't a form-class.
I tried to change to my class in Program.main() but it looks like Application.run() needs a ApplicationContext.
I guess that I could change the Program-class to start another class and let that class start the form with Application.run() but I think that it will cause a lot of problem since I don't want the same form to be started first each time and Application.run() have to be used at least once and at most once. So I think it will be hard to keep track of if Application.run() has been used or not.
Another question that might be even more important; Is this a good way to do things in .net? The reason I want to do so is because I want to create some sort of MVC project where the class I want to start with is the controller and all forms I'll use will be views.
© Stack Overflow or respective owner