Solved

Updating labels quickly without a flicker

Posted on 2002-07-03
7
842 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
DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

 
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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

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…
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…
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

773 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