Blinking item in TListView

Posted on 2004-08-03
Last Modified: 2010-04-05
How may I blink a specific item in TListView?

Question by:faustomen
  • 2

Accepted Solution

Colin_Dawson earned 125 total points
ID: 11705519
You need to make your own drawing routine for the TListview.  Take a look at OnDrawItem,  then you'll need to add a TTimer, that will control the blinking.  don't use .Paint, but use .invalidate to ask the TListview to re-draw.
LVL 26

Expert Comment

by:Russell Libby
ID: 11708365

Something like the following will allow you to "blink" (it inverts the image)  the list item without having to use a timer, and without having to implement owner-drawing. May make things a little easier to implement....


procedure BlinkListItem(Item: TListItem);
var  hdcPaint:      HDC;
      rcBounds:      TRect;

  // Check assignment
  if Assigned(Item) then
     // Get the bounds rect for the item
     // Get the window DC
     // Invert the item
     Assert(InvertRect(hdcPaint, rcBounds), 'Failed to invert the rectangle');
     // Release the dc
     ReleaseDC(Item.Handle, hdcPaint);
     // Validate the item rectangle
     ValidateRect(Item.Handle, @rcBounds);
     // Delay
     // Have the item repaint
     InvalidateRect(Item.Handle, @rcBounds, True);



Expert Comment

ID: 11743720
I'm glad that I gave you enough information to be able to solve this problem.

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

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
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…
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

911 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

17 Experts available now in Live!

Get 1:1 Help Now