TAdvSmoothListBox CustomItemFill bug ?

Hello,


I think I have found a bug in the TAdvSmoothListBox control. In another topic "TAdvSmoothListBox hover effect" you advised me to use a small bit of code to achieve a hover effect. This code works perfectly on Windows 7 and below, but on WIndows 8 the behaviour is completely erratic.

I have created a small application to reproduce the situation. I dropped a TAdvSmoothListBox control on a form, linked it to an imagelist, and created some items, all with a Left graphic from the imagelist (type gtImage).

I am using the following code to achieve the hover effect :

---
unit Unit1;

interface

uses
  Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
  Vcl.Controls, Vcl.Forms, Vcl.Dialogs, AdvSmoothListBox, Vcl.ImgList, cxGraphics, GDIPFill;

type
  TForm1 = class(TForm)
    AdvSmoothListBox1: TAdvSmoothListBox;
    cxImageList1: TcxImageList;
    procedure AdvSmoothListBox1ItemMouseEnter(Sender: TObject;
      itemindex: Integer);
    procedure AdvSmoothListBox1ItemMouseLeave(Sender: TObject;
      itemindex: Integer);
    procedure AdvSmoothListBox1ItemCustomizeFill(Sender: TObject;
      Item: TAdvSmoothListBoxItem; AFill, ADisabledFill,
      ASelectedFill: TGDIPFill);
  public
    objHoverItemIndex: Integer;
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.AdvSmoothListBox1ItemCustomizeFill(Sender: TObject;
  Item: TAdvSmoothListBoxItem; AFill, ADisabledFill, ASelectedFill: TGDIPFill);
begin
  if (objHoverItemIndex = Item.Index) then
  begin
    AFill.Color := clWhite;
  end;
end;

procedure TForm1.AdvSmoothListBox1ItemMouseEnter(Sender: TObject;
  itemindex: Integer);
begin
  objHoverItemIndex := ItemIndex;
  AdvSmoothListBox1.Invalidate();
end;

procedure TForm1.AdvSmoothListBox1ItemMouseLeave(Sender: TObject;
  itemindex: Integer);
begin
  objHoverItemIndex := -1;
  AdvSmoothListBox1.Invalidate();
end;

end.
---

This works in Win7, but not win Win8. I can send you a small project if you want.

Can you reproduce this bug, and if so, provide a solution ?

Thanks in advance.

Hi, 


It would be unclear why this would make any difference, but you can send us your sample so we can investigate here.

Kind Regards, 
Pieter

Hello,


I dont know what is unclear exactly, but I have sent you an example project demonstrating the problem I am experiencing. I am using version 6.4.2 of you Component Pack.