要么重画图标,要么FillRect时让开图标

解决方案 »

  1.   

    to Lionheart:具体怎么做,就象ACDSEE一样???
      

  2.   

    我是这样做的 
    procedure TsysForm.ListBox1DrawItem(Control: TWinControl; Index: Integer;
      Rect: TRect; State: TOwnerDrawState);
    var
      ss:string;
    begin
    if odFocused in State then
      begin
         ListBox1.Canvas.Brush.Color:=clBlue;
         ListBox1.Canvas.FillRect(Rect);
         ListBox1.Canvas.Font.color:=clWhite;
      end
      else
      begin
         ListBox1.Canvas.Brush.Color:=clWhite;
         ListBox1.Canvas.FillRect(Rect);
         ListBox1.Canvas.Font.color:=clblack;
      end;
      if Selected[Index] then
         ss:='√'+ListBox1.Items[Index]
      else
         ss:=' '+ListBox1.Items[Index];
      ListBox1.Canvas.textOut(Rect.Left+5,Rect.top+4,ss);
    end;