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.
Thanks.
* Update *
Hi again. I have tried both answers, and incorporated this one from Hans Passant into my code, and eventually resolved all the error messages. However, it hasn't fixed the problem, as my splash screen does not stay open for 5 secs. It appears that the MS splash screen and minimum display time code can only be accessed if the Application Framework is being used, and I'm trying to produce my own custom startup, as I want to begin with a module/class function, rather than a form. Any (more) ideas? Thanks.