Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Updating labels quickly without a flicker

Posted on 2002-07-03
7
Medium Priority
?
977 Views
Last Modified: 2010-04-04
I'm collecting data from a data Aquisition device.  Right now I'm only gathering the data about once per second.  I'm using pre-positioned labels on the form to display the information by the following method.

Inside a Timer loop with intervals at 1000
Query the Device
Assign the value to each label (about 30 labels)
application.processmessages

My labels flicker real bad and sometimes just blank out
with a white background like I'm not getting them displayed properly.

Is there a better way to handle this, or even a better way to display the data prepositioned on the form?

I can update a memo with the information to verify all the data is correct, and also to make sure the query isn't taking to long, so I believe it's the technique I'm attemping to use.
0
Comment
Question by:rwskinner
7 Comments
 
LVL 27

Expert Comment

by:kretzschmar
ID: 7126582
-place a panel as background-container
-set doublebuffered to true
0
 
LVL 3

Accepted Solution

by:
marcoszorrilla earned 200 total points
ID: 7126601
Try puttint DoubleBuffered:=True;
You can do a test with this very simple sample.

procedure TForm1.Button1Click(Sender: TObject);
var
i:Integer;
begin

DoubleBuffered:=True;
for i:=1 to 10000 do
begin
Application.ProcessMessages;
label1.Caption:=IntToStr(i);
end;


Best Regards.
Marcos.
0
 
LVL 27

Expert Comment

by:kretzschmar
ID: 7126629
btw. marcoszorrilla

take your points at q
http://www.experts-exchange.com/delphi/Q_20318113.html

meikl ;-)
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 3

Expert Comment

by:marcoszorrilla
ID: 7126632
Sorry Kretzschmar when I start to prepare my example ther is any answer.

Best Regards.
Marcos.
0
 
LVL 27

Expert Comment

by:kretzschmar
ID: 7126642
doesn't matter, marcos,

but take your points from qow 18 at
http://www.experts-exchange.com/delphi/Q_20318113.html
0
 

Expert Comment

by:Zoly
ID: 7127580
Also, using TStaticText instead of TLabel is always an idea worth considering. TStaticText is a TWinControl while TLabel is a TControl and so you get much smoother effects (less/no flicker) with TStaticText.

Z
0
 

Author Comment

by:rwskinner
ID: 7130831
Thanks for the help.  That cured the problem.  I added the refresh command as well and it helped.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
this video summaries big data hadoop online training demo (http://onlineitguru.com/big-data-hadoop-online-training-placement.html) , and covers basics in big data hadoop .
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…
Suggested Courses

885 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question