Solved

How to stop dbgrid to redraw while loading data

Posted on 1998-04-10
3
203 Views
Last Modified: 2012-05-04
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.
0
Comment
Question by:hansbos
  • 2
3 Comments
 
LVL 8

Accepted Solution

by:
MikeP090797 earned 100 total points
Comment Utility
Use the LockWindowUpdate API:
Declare Function LockWindowUpdate Lib "user32" (ByVal hwndLock As Long) As Long

'Lock:
LockWindowupdate db1.hwnd

'unlock
LockWindowUpdate 0
0
 

Author Comment

by:hansbos
Comment Utility
Thanks. It works perfectly.
0
 

Author Comment

by:hansbos
Comment Utility
Thanks. It works perfectly.
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now