Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Updating labels quickly without a flicker

Posted on 2002-07-03
7
855 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 50 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
Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

765 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