How to stop dbgrid to redraw while loading data

In my application I load about 1000 records in a table which is connected to a DBGrid. How can I control the redrawing of the DBGrid during the load process? I would like to stop the redraw temporarily to speed things up.
hansbosAsked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
MikeP090797Connect With a Mentor Commented:
Use the LockWindowUpdate API:
Declare Function LockWindowUpdate Lib "user32" (ByVal hwndLock As Long) As Long

'Lock:
LockWindowupdate db1.hwnd

'unlock
LockWindowUpdate 0
0
 
hansbosAuthor Commented:
Thanks. It works perfectly.
0
 
hansbosAuthor Commented:
Thanks. It works perfectly.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.