Just do all the drawing yourself. ie:
procedure TForm19.ListView1CustomDrawItem(Sender: TCustomListView; Item: TListItem; State: TCustomDrawState; var DefaultDraw: Boolean); var lRect: TRect; lFlags: Cardinal; begin lRect := Item.DisplayRect(drLabel); ListView1.Canvas.Brush.Style := bsSolid; ListView1.Canvas.Brush.Color := clYellow; ListView1.Canvas.FillRect(lRect); ListView1.Canvas.Font.Color := clRed; lFlags := DT_SINGLELINE or DT_CENTER or DT_VCENTER; DrawText(ListView1.Canvas.Handle, PChar(Item.Caption), Length(Item.Caption), lRect, lFlags); DefaultDraw := False; end; On Nov 29, 2007 9:32 PM, Ross Levis <[EMAIL PROTECTED]> wrote: > > > > Anyone know if it's possible to prevent a listview from showing the selected > highlight colour on selected items? > > > > I want to display a specific brush colour depending on the type of item, > which I do with OnCustomDrawItem, but the colour only displays when I move > the focus away from the listview. It goes back to the usual blue colour > when the listview gets the focus again. > > > > I'm trying to find a Windows parameter to use in CreateParams, or even > modify the ComCtrls unit if necessary, but I can't a way to do it. > > > > Thanks, > > Ross. > _______________________________________________ > NZ Borland Developers Group - Delphi mailing list > Post: [email protected] > Admin: http://delphi.org.nz/mailman/listinfo/delphi > Unsubscribe: send an email to [EMAIL PROTECTED] with Subject: > unsubscribe > _______________________________________________ NZ Borland Developers Group - Delphi mailing list Post: [email protected] Admin: http://delphi.org.nz/mailman/listinfo/delphi Unsubscribe: send an email to [EMAIL PROTECTED] with Subject: unsubscribe
