11
What is the difference between the methods:
- Refresh, tcontrol;
- Update, tcontrol;
- Repaint, also deTControl; and,
- Invalidate, also of Tcontrol;
- Beyond the Application.Processmessages?
11
What is the difference between the methods:
14
The method Invalidate only marks the component to be painted the next time the interface is updated. It does not re-draw the component at the time it was called.
Method that re-scores the component immediately, since it has already been invalidated, without waiting for the processing of re-drawing messages by Windows. Generates processor time consumption as you will stop all activities of the application’s main thread to redesign.
This means that if you have changed something that implies a visual change, and the component has not been Invalidated, after the update the change may not be processed.
repaint forces component to re-draw immediately. If property ControlStyle
include csOpaque
, component will redesign, otherwise the method will be executed Invalidate
and then the method Update
According to the documentation the Refresh
executes the Repaint
, and therefore do exactly the table thing, so much so that it is still stated that they are interchangeable, that is, either use one or the other
Forces the application to process Windows messages.
When the application is performing a high-cost processing operation, or looping, the thread is busy performing that operation and does not process any Windows message to the application, such as a click on a component, the pressing of a key or in this case the updating of the graphical components of the application.
Be call the method Invalidate
and right after Application.ProcessMessages
, windows will handle the Invalidate message and provide the re-design of the window or component along with all other messages.
Browser other questions tagged delphi
You are not signed in. Login or sign up in order to post.