Board index » delphi » label.caption doesn't imediately execute
Mike
![]() Delphi Developer |
Tue, 15 Nov 2005 20:48:58 GMT
|
Mike
![]() Delphi Developer |
Tue, 15 Nov 2005 20:48:58 GMT
label.caption doesn't imediately execute
My Delphi 5 program changes a label on the form to indicate that data is
being processed. After that instruction, THEN the process begins. Yet the label is not being updated until after the processing .....code snippet below: form1.label1.caption:='beginning data analysis'; I appreciate an explanation of why, and a workaround if possible. Thanks! |
Maarten Wiltin
![]() Delphi Developer |
Tue, 15 Nov 2005 21:14:19 GMT
Re:label.caption doesn't imediately executeQuoteMike wrote in message ... is implemented by sending it a Windows message, with one of its parameters being a pointer to the new text. Sending messages can be done synchronously (SendMessage), which Setting the new caption is probably done synchronously. But that's The workaround is quite easy if you know how these things work. If your processing takes any noticeable time at all, it is usually Read up on WM_PAINT, Invalidate, Refresh, and Update. Groetjes, |
Dirk Claessen
![]() Delphi Developer |
Tue, 15 Nov 2005 21:19:56 GMT
Re:label.caption doesn't imediately executeon 30 mei 2003, "Mike" wrote : Quote> My Delphi 5 program changes a label on the form to indicate that data chance to process it's message loop, and hence will not update the form. Either intersperse the load_files proc. with Application.ProcessMessages, form1.label1.caption:='beginning data analysis'; -- |
Kelly Leah
![]() Delphi Developer |
Tue, 15 Nov 2005 22:35:54 GMT
Re:label.caption doesn't imediately executeQuote> The workaround is quite easy if you know how these things work. make sure that your computation can't be started more than once... My favorite is one recommended by Allan LLoyd (IIRC, sorry if I'm wrong) on say your event handler (that does the work) is called Button1Click and then in the first line of Button1Click (or at least somewhere before the Button1.OnClick := nil; then after the processmessages (the last one you do in the event handler, or Button1.OnClick := Button1Click; Kelly |
Mike
![]() Delphi Developer |
Wed, 16 Nov 2005 01:38:01 GMT
Re:label.caption doesn't imediately executethanks for the help! i'll read up on topics listed, and try suggested presented. I appreciate it! Quote"Dirk Claessens" <will.bounce@invalid> wrote in message Quote> on 30 mei 2003, "Mike" wrote : |
Plettner-Data - MerCato
![]() Delphi Developer |
Wed, 16 Nov 2005 04:41:43 GMT
Re:label.caption doesn't imediately executeHi Mike. As stated before you app continues the execution before windows gets a The functionality of this is like the old Yield command, that allows windows Quote"Mike" <no...@hotmail.com> wrote in message Quote> My Delphi 5 program changes a label on the form to indicate that data is |
Mike
![]() Delphi Developer |
Wed, 16 Nov 2005 22:34:10 GMT
Re:label.caption doesn't imediately executethanks all! got it working just fine now! "Plettner-Data - MerCator" <kenn...@plettner-data.dk> wrote in message Quote> Hi Mike. |
Maarten Wiltin
![]() Delphi Developer |
Thu, 17 Nov 2005 16:45:29 GMT
Re:label.caption doesn't imediately executeQuotePlettner-Data - MerCator wrote in message ... Quote>The functionality of this is like the old Yield command, that allows Groetjes, |
Nicholas Sherloc
![]() Delphi Developer |
Fri, 18 Nov 2005 15:26:08 GMT
Re:label.caption doesn't imediately executeQuote"Kelly Leahy" <kellyle...@swbell.net> wrote in message Quote> Make sure if you use Application.ProcessMessages, you take some action to for TTimers - stops the event from running again while it's still going (If you use application.processmessages inside your timer) Cheers, |
1. Label's caption doesn't show
2. Fast label.caption:='...' updates
3. Change others application's label caption
4. Label's and Captions and Macros
6. Show dialog - label doesn't show
8. TLabel - OnMouseMove event doesn't execute
9. SaveDialog doesn't like all filenames and executes but returns false without indication