form freezing when loading data

  • Thread starter Thread starter alex
  • Start date Start date
A

alex

Hi,
I am loading quite a large list into a datagrid and while doing so the
form freezes... and for 10-20 seconds i have quite a messy screen. e.g.
the file chooser half deleted and still half visible till the data is
entirely loaded.

Is there a way to prevent that? e.g. referesh the screen before loading
starts or allow the file chooser window to close before the loading starts.

Thanks
Alex
 
Hi Alex,

I'm surprised nobody answered you earlier. !??!

I presume that you're initialising the DataGrid in Form_Load. To get the
Form to show properly, try calling Me.Show before you set up the DataGrid. If
that's not enough, add Me.Refresh.. If that's not enough, use
Application.DoEvents. If that's not enough, set a timer to go off in 100
millisecs or so. On the timer, do your DataGrid initialisation. If that's not
enough, learn about Threads and do it in a separate Thread.

Phew. Something in there will do it for you, I hope. :-)

Regards,
Fergus
 
Back
Top