programstinator
programstinator

Reputation: 1376

Refresh label caption before loading?

I have a piece of code:

setEnableControls(false);
lblLoading.Caption:='Loading tree contents, please wait.';
someBigLoading(); 
setEnableControls(true);
lblLoading.Caption:='';

The problem is, the label's caption text doesn't refresh until after the "big loading" is complete. Is there a way to make the program process the message in the message queue, BEFORE going onto the next command?

Upvotes: 3

Views: 2845

Answers (1)

gabr
gabr

Reputation: 26850

Just call lblLoading.Update. This will update the label and will not introduce any problems that can spur from processing messages in the middle of the code.

Upvotes: 8

Related Questions