faustomen
asked on
Blinking item in TListView
How may I blink a specific item in TListView?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
I'm glad that I gave you enough information to be able to solve this problem.
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....
Regards,
Russell
procedure BlinkListItem(Item: TListItem);
var hdcPaint: HDC;
rcBounds: TRect;
begin
// Check assignment
if Assigned(Item) then
begin
// Get the bounds rect for the item
rcBounds:=Item.DisplayRect
// Get the window DC
hdcPaint:=GetDC(Item.Handl
// Invert the item
Assert(InvertRect(hdcPaint
// Release the dc
ReleaseDC(Item.Handle, hdcPaint);
// Validate the item rectangle
ValidateRect(Item.Handle, @rcBounds);
// Delay
Sleep(500);
// Have the item repaint
InvalidateRect(Item.Handle
end;
end;