Solved

Updating labels quickly without a flicker

Posted on 2002-07-03
7
801 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
Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

 
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

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

760 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now