Right now I have a vb.net windows form project that does a whole bunch of
things on the form.load event. The problem with this is that the user does
not see the form until all the those things are done.

Is there a way for a form to be shown first AND THEN have it automatically
start to run through my code? (perhaps a different event??? form.paint,
form.activate)

Right now... the form is running but the user can't see it, and so they end
up clicking on the application to run again and the user thinks the program
is slow... AND WE CAN'T HAVE THAT!!!! :)

I would like:
Basically the form would load
i would have a status bar that says "loading data"... and then the form
would then show the data once it's loaded

Any help would be greatly appreciated!
Chris Thunell
cthunell@pierceassociates.com

Re: Form Load -> show form... then do stuff by Jeff

Jeff
Wed Aug 31 09:40:20 CDT 2005

On 31/08/2005 Chris Thunell wrote:

> I would like:
> Basically the form would load
> i would have a status bar that says "loading data"... and then the
> form would then show the data once it's loaded


Use a global boolean variable called something like m_blnActivated, set
it to false, then put all your stuff in the Form Activate event but
only run it if m_blnActivated is false. After the first run set
m_blnActivated to true so it doesn't run again.

I have just used this technique in an app where I had the same issue as
you.

--
Jeff Gaines

Re: Form Load -> show form... then do stuff by Cor

Cor
Wed Aug 31 09:47:36 CDT 2005

Chris,

You can replace all your not real formloading code to the form_activated
event and than set in it

\\\
static done as boolean
if not done then
....
....
done = true
end if
///

I hope this helps,

Cor



Re: Form Load -> show form... then do stuff by Mona

Mona
Wed Aug 31 15:55:22 CDT 2005

Hi Chris,
How are you doing?

I would suggest you to start your project with a form with a progress or
some message informing the users that the application is loading
and in this form put up the code for loading your real form. When the real
form has completed loading you may place the first startup form
to hide/unload in the real form's activate event.

I hope this is helpful.


Thanks
Mona
[Grapecity]

"Chris Thunell" <cthunell@pierceassociates.com> wrote in message
news:OaFzzEjrFHA.4072@TK2MSFTNGP09.phx.gbl...
> Right now I have a vb.net windows form project that does a whole bunch of
> things on the form.load event. The problem with this is that the user
does
> not see the form until all the those things are done.
>
> Is there a way for a form to be shown first AND THEN have it automatically
> start to run through my code? (perhaps a different event??? form.paint,
> form.activate)
>
> Right now... the form is running but the user can't see it, and so they
end
> up clicking on the application to run again and the user thinks the
program
> is slow... AND WE CAN'T HAVE THAT!!!! :)
>
> I would like:
> Basically the form would load
> i would have a status bar that says "loading data"... and then the form
> would then show the data once it's loaded
>
> Any help would be greatly appreciated!
> Chris Thunell
> cthunell@pierceassociates.com
>
>



Re: Form Load -> show form... then do stuff by mf_sina

mf_sina
Thu Sep 01 03:02:18 CDT 2005


I think the best way is to put a timer control on a form. so when form is
loaded, timer control will start and put your codes there.
you can set any timerinterval for that timer which in my perspective is the
best solution for your question.



"Mona" <mona@discussions.com> wrote in message
news:%23FclP5mrFHA.1984@tk2msftngp13.phx.gbl...
> Hi Chris,
> How are you doing?
>
> I would suggest you to start your project with a form with a progress or
> some message informing the users that the application is loading
> and in this form put up the code for loading your real form. When the real
> form has completed loading you may place the first startup form
> to hide/unload in the real form's activate event.
>
> I hope this is helpful.
>
>
> Thanks
> Mona
> [Grapecity]
>
> "Chris Thunell" <cthunell@pierceassociates.com> wrote in message
> news:OaFzzEjrFHA.4072@TK2MSFTNGP09.phx.gbl...
>> Right now I have a vb.net windows form project that does a whole bunch of
>> things on the form.load event. The problem with this is that the user
> does
>> not see the form until all the those things are done.
>>
>> Is there a way for a form to be shown first AND THEN have it
>> automatically
>> start to run through my code? (perhaps a different event??? form.paint,
>> form.activate)
>>
>> Right now... the form is running but the user can't see it, and so they
> end
>> up clicking on the application to run again and the user thinks the
> program
>> is slow... AND WE CAN'T HAVE THAT!!!! :)
>>
>> I would like:
>> Basically the form would load
>> i would have a status bar that says "loading data"... and then the form
>> would then show the data once it's loaded
>>
>> Any help would be greatly appreciated!
>> Chris Thunell
>> cthunell@pierceassociates.com
>>
>>
>
>



Re: Form Load -> show form... then do stuff by Chris

Chris
Thu Sep 01 08:23:32 CDT 2005

Do you want your users to be able to interact with the form once it is
shown? If so, then you might want to look at spawning a new thread to
perform the long running process.

If the users should *not* interact with the form until after the
loading process has completed, then use one of the techniques posted by
other users but show a splash form to indicate that the program is
still loading.


Re: Form Load -> show form... then do stuff by Jeff

Jeff
Thu Sep 01 10:54:08 CDT 2005

To simply show the form before other processes run, I use this:
Me.Show()
Me.Refresh()
Application.DoEvents()

To indicate the form isn't yet ready for use, I prefer some kind of
status message combined with an hourglass.
sbpStatusBar_MessagePanel.Text = "Loading..."
Me.Cursor = Windows.Forms.Cursors.WaitCursor

Of course, to be certain these appear to the user, place them before
the Refresh() call.

HTH

Jeff J.