How do I get my Windows Forms application to use a custom main function and get access to the Applic
Posted
by burble
on Stack Overflow
See other posts from Stack Overflow
or by burble
Published on 2010-04-30T09:43:33Z
Indexed on
2010/04/30
9:47 UTC
Read the original article
Hit count: 178
Hi Folks
I am trying to use a Main () function in a class to control the program flow in my vb .net Windows Forms application. I have added a splash screen component and a login screen, and customised my main sdi form. I have set the startup form to be my main function in the Application Page of the Project Designer, and everything seems to work fine(ish).
However, I would like to use: Me.MinimumSplashScreenDisplayTime = 5000
to ensure that the splash screen is visible, but it is not recognised by the system unless I tick the Enable Application Framework check box on the Project Designer. If I do this, on startup the program ignores the login and splash screens and all my customisation and just displays a default Form1, even though I have also specified my splash screen in the AF dropdown list.
Of course, there are alternative ways to delay a splash screen, such as putting the thread temporarily to sleep (which didn't seem to work), but I suspect that there are other things in the AF that I may want to use.
Any suggestions on how I can get round this please, and get a sensible means of controlling program flow? Any thoughts on the best overall structure for organising program flow would also be helpful too. I am concerned both about going down a Microsoft or an alternative custom route that may cause me problems later, as the application becomes more complex.
Thankses.
© Stack Overflow or respective owner