Solved

Delphi clock in listview

Posted on 2008-10-21
3
425 Views
Last Modified: 2013-11-23
I have a listview component on a form and would like one of the columns to be a clock counting down to zero.

Does anyone know how I can do this?
0
Comment
Question by:alanrogerson2
3 Comments
 
LVL 15

Expert Comment

by:mikelittlewood
ID: 22768277
Would this be a different clock for every item in the listview?
0
 
LVL 37

Accepted Solution

by:
Geert Gruwez earned 500 total points
ID: 22768284
put a timer on your form which has the ListView

in the OnTimer event change the value of the CountDown
and update the ListView

type
  TForm1 = class(TForm)
  private
    fCountDown: integer;
  end;
 
procedure TForm1.Timer1OnTimer(Sender: TObject);
begin
  if CountDown > -1 then
  begin
    CountDown := CountDown - 1;
    ListView1.Items.Item[0].SubItems[1] := IntToStr(CountDown);
  end else Timer1.Enabled := False;
end;
0
 

Author Closing Comment

by:alanrogerson2
ID: 31508342
That's worked.. thanks!
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

In our object-oriented world the class is a minimal unit, a brick for constructing our applications. It is an abstraction and we know well how to use it. In well-designed software we are not usually interested in knowing how objects look in memory. …
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
The viewer will learn how to synchronize PHP projects with a remote server in NetBeans IDE 8.0 for Windows.

932 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

12 Experts available now in Live!

Get 1:1 Help Now