We help IT Professionals succeed at work.

We've partnered with Certified Experts, Carl Webster and Richard Faulkner, to bring you two Citrix podcasts. Learn about 2020 trends and get answers to your biggest Citrix questions!Listen Now


Making controls refresh in Delphi

riskassessor asked
Medium Priority
Last Modified: 2008-01-09
I have an application that I am running in the IDE. It has some TDBGrid controls which scroll as my program works through various database tables. I placed some other controls on the form to indicate progress but these don't update till the program has finsihed. I cannot figure out why! Any suggestions?
Watch Question

use Refresh method of a control You want to refresh immediately after operation.
Otherwise it refreshes in some idle time.

Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts
Use Application.ProcessMessages within your code where you would like the updates to occur.
I'm not sure if this is what is needed in this case, but sometimes I have found that calling the Repaint method is the best way to get a control to immediately redisplay itself. Repaint is a public virtual method of TControl.


Thanks to everyone for solutions.

Refresh (of either the form or control) works. Just put it in the code where you want the control/form to update.

Application.ProcessMessages also works. (You need to include Forms in Uses)

Repaint works interchangeably with Refresh (seem to be different names for same command).

Thanks again.
Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.


Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.