Re: Splash Screen - My Nemesis
Brady Kelly <[email protected]> Thu, 26 Jul 2007 16:32:16 +0200
| Newsgroups | gmane.comp.windows.devel.dotnet.winforms |
|---|---|
| Organization | Chase Software |
| Message-ID | <[email protected]> |
> I would first put together a clear statement of *exactly* what the > problem is (rather than vague hand waving) before trying to solve it. OK, maybe if I describe the original problem first, someone more au faix with .NET UI can steer me in the right direction; identify my bad practices and suggest some better ones. This is a very small, two form search application. The main form is a search form, with fields for search criteria and a DataGridView for search results. It connects to a SQL Server DB to populate a criteria drop down and to fetch search results. I have an exception handler in Load that shows a message box if there is an error initialising controls, which is basically just populating the drop down. On deployment, the connection string was incorrect but the message box only displayed after some time, leaving the uneducated user guessing as to whether they had started the app correctly. Sometimes this delay was also due to long query times on the database. I was requested by the client to add a splash screen, to give the user immediate feedback of the application starting. I thought a splash screen would server two purposes, first in the intended one, second in adding a little visual appeal. Given the popular misconception this would be easy to achieve, I thought I could quickly add the splash screen last night and avoid lengthy reworks elsewhere. I was wrong. I think now, to achieve the clients requirement of immediate feedback, I will forego the splash screen and show the main form immediately, delegating the database interaction to a separate thread started by the main form. Now, do I do this in the Load event, as I need the form to already be visible before I spawn another thread? I'd like to get back to the ins and outs of a splash screen, using Andrew's very suitable example, with maybe some of the changes that have been discussed here, but I first want to deliver something to the client.