Delphi clock in listview

Posted on 2008-10-21
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?
Question by:alanrogerson2
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
LVL 15

Expert Comment

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

Accepted Solution

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

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

Author Closing Comment

ID: 31508342
That's worked.. thanks!

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

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.

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…
Jaspersoft Studio is a plugin for Eclipse that lets you create reports from a datasource.  In this article, we'll go over creating a report from a default template and setting up a datasource that connects to your database.
The viewer will learn how to use NetBeans IDE 8.0 for Windows to connect to a MySQL database. Open Services Panel: Create a new connection using New Connection Wizard: Create a test database called eetutorial: Create a new test tabel called ee…
The viewer will learn how to use and create new code templates in NetBeans IDE 8.0 for Windows.

729 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