Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Apr 27th, 2006, 3:16 PM   #1
Kazy
Newbie
 
Join Date: Sep 2005
Posts: 21
Rep Power: 0 Kazy is on a distinguished road
Setting Label Caption Is delayed

I'm trying to keep a status bar telling the user what the program is doing. However, when I set the caption on the status label, it seems to be delayed. For instance:

Label3.Caption := 'Reading data from file...';
// Read Data from file into string list
while not EOF(SomeTxtFile) do begin
ReadLn(SomeTxtFile, buffer);
string_list.Add(Trim(buffer));
Memo1.Lines.Add(buffer);
end;

When my program gets to this code, Label3 does not change to "Reading data from file...", and the loop runs. At the very end of my program, I do:
Label3.Caption := 'Done.'; and that is the only time the Caption gets changed during the entire program.

Does anyone have any ideas on why this happens? I'm new to Delphi so I'm not sure if there is a delay or what.
Kazy is offline   Reply With Quote
Old May 5th, 2006, 12:39 PM   #2
RoddieRod
Newbie
 
RoddieRod's Avatar
 
Join Date: May 2006
Location: Pgh, Pa
Posts: 1
Rep Power: 0 RoddieRod is on a distinguished road
Send a message via AIM to RoddieRod Send a message via Yahoo to RoddieRod
Try placing

refresh;

after the Label3.Caption line.
RoddieRod is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 4:30 PM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC