PDA

Click to See Complete Forum and Search --> : form doesn't show before long process


David Laplante
Nov 23rd, 1999, 11:57 AM
I am populating a listview with a 4000 records recordset on FORMLOAD. the thing is my form does not show before leaving the user with the impression that the system froze for about 7 seconds.
Is there a way to show the form before populating the listview? I have tried populating on Form_Activate and also me.refresh before populating with no luck.

SteveS
Nov 23rd, 1999, 12:29 PM
I have similar programs, with alot of uploads at startup that seem like the machine has hung for a short period of time.

I always use a 'Splash Screen' and a 'DoEvents' statement in the Startup procedure loop.

For Example

Create a new Module
Create a Sub in the Module as follows

Sub Main()
Load frmSplash
frmSplash.Show
DoEvents

'Main Loop here (Populate the 4000 entries)

UnLoad frmSplash
frmMain.Show
End Sub

Steve.

Gaurav
Nov 23rd, 1999, 06:13 PM
Hi,
Well here's one dirty way of doing it :)
have your PopulateMyListView code written in a timer routine.

enable this timer (with a interval of 1 sec) just before you exit the form_load routine.

This would fire the timer event 1 sec after your form loads, and then the user would effectively see the listview filling up with its contents.

The 1 sec. interval is ofcourse your prerogrative, u could run for milliseconds too :)

hope this helps

------------------
Gaurav Mahindra
gmahindra@extentia.com

Serge
Nov 23rd, 1999, 07:08 PM
Try to move your code to Form_Activate event. It will show the form an then populate the ListView. Durring populating time you can provide the user with the Hourglass cursor, so he/she will know that the process is running.

------------------

Serge

Software Developer
Serge_Dymkov@vertexinc.com
Access8484@aol.com
ICQ#: 51055819 (http://www.icq.com/51055819)



[This message has been edited by Serge (edited 11-24-1999).]

David Laplante
Nov 24th, 1999, 07:16 AM
Thanks for your advice.... I had already tried it on Form_Activate and thought it didn't work but found out that I had some code in Form_Load that changed a value in a ComboBox and THAT trigered the populating of the list... hhehehe had to work a little there...

Thanks...
David Laplante