procedure TJvDBLookupList.Paint; var I, J, TextHeight, TextMargin: Integer; Image: TGraphic; Bmp: TBitmap; R, ImageRect: TRect; Selected: Boolean; begin Bmp := TBitmap.Create; try Canvas.Font := Font; TextHeight := GetTextHeight; if ColorToRGB(Color) <> ColorToRGB(clBtnFace) then Canvas.Pen.Color := clBtnFace else Canvas.Pen.Color := clBtnShadow; for I := 0 to FRowCount - 1 do begin J := I - Ord(EmptyRowVisible); Canvas.Font.Color := Font.Color; Canvas.Brush.Color := Color; Selected := not FKeySelected and (I = 0) and not EmptyRowVisible; R.Top := I * TextHeight; R.Bottom := R.Top + TextHeight; if I < FRecordCount + Ord(EmptyRowVisible) then begin if (I = 0) and (J = -1) then begin if ValueIsEmpty(FValue) then {$IFDEF JVCLStylesEnabled} //ADDED if StyleServices.Enabled and TStyleManager.IsCustomStyleActive then //ADDED begin //ADDED Canvas.Font.Color := StyleServices.GetSystemColor(clHighlightText); //ADDED Canvas.Brush.Color := StyleServices.GetSystemColor(clHighlight); //ADDED Selected := True; //ADDED end //ADDED else //ADDED {$ENDIF JVCLStylesEnabled} //ADDED begin Canvas.Font.Color := clHighlightText; Canvas.Brush.Color := clHighlight; Selected := True; end else Canvas.Brush.Color := EmptyItemColor; R.Left := 0; R.Right := ClientWidth; Image := GetPicture(False, True, TextMargin); if TextMargin > 0 then begin Bmp.Canvas.Font := Canvas.Font; Bmp.Canvas.Brush := Canvas.Brush; Bmp.Canvas.Pen := Canvas.Pen; Bmp.Width := RectWidth(R); Bmp.Height := RectHeight(R); ImageRect := Bounds(0, 0, TextMargin, RectHeight(R)); Bmp.Canvas.FillRect(ImageRect); if Image <> nil then DrawPicture(Bmp.Canvas, ImageRect, Image); DrawItemText(Bmp.Canvas, Bounds(TextMargin, 0, RectWidth(R) - TextMargin, RectHeight(R)), Selected, True); Canvas.Draw(R.Left, R.Top, Bmp); end else DrawItemText(Canvas, R, Selected, True); end else begin FLookupLink.ActiveRecord := J; if not ValueIsEmpty(FValue) and (FKeyField.AsString = FValue) then {$IFDEF JVCLStylesEnabled} //ADDED if StyleServices.Enabled and TStyleManager.IsCustomStyleActive then //ADDED begin //ADDED Canvas.Font.Color := StyleServices.GetSystemColor(clHighlightText); //ADDED Canvas.Brush.Color := StyleServices.GetSystemColor(clHighlight); //ADDED Selected := True; //ADDED end //ADDED else //ADDED {$ENDIF JVCLStylesEnabled} //ADDED begin Canvas.Font.Color := clHighlightText; Canvas.Brush.Color := clHighlight; Selected := True; end; R.Left := 0; R.Right := ClientWidth; Image := GetPicture(False, False, TextMargin); if TextMargin > 0 then begin Bmp.Canvas.Font := Canvas.Font; Bmp.Canvas.Brush := Canvas.Brush; Bmp.Canvas.Pen := Canvas.Pen; Bmp.Width := RectWidth(R); Bmp.Height := RectHeight(R); ImageRect := Bounds(0, 0, TextMargin, RectHeight(R)); Bmp.Canvas.FillRect(ImageRect); if Image <> nil then DrawPicture(Bmp.Canvas, ImageRect, Image); DrawItemText(Bmp.Canvas, Bounds(TextMargin, 0, RectWidth(R) - TextMargin, RectHeight(R)), Selected, False); Canvas.Draw(R.Left, R.Top, Bmp); end else DrawItemText(Canvas, R, Selected, False); end; end; R.Left := 0; R.Right := ClientWidth; if J >= FRecordCount then Canvas.FillRect(R); if Selected and (FFocused or FPopup) then Canvas.DrawFocusRect(R); end; finally Bmp.Free; end; if FRecordCount <> 0 then FLookupLink.ActiveRecord := FRecordIndex; end;