Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Delphi clock in listview

Posted on 2008-10-21
3
Medium Priority
?
457 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
[X]
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
3 Comments
 
LVL 15

Expert Comment

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

Accepted Solution

by:
Geert Gruwez earned 2000 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

New benefit for Premium Members - Upgrade now!

Ready to get started with anonymous questions today? It's easy! Learn more.

Question has a verified solution.

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

In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
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.
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.
Suggested Courses

670 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