CODE
procedure TNxMemoItemDisplay.PaintValueData;
procedure DrawLines;
var
i: Integer;
r: TRect;
B: Graphics.TBitmap;
begin
r := GetTextRect;
B := Graphics.TBitmap.Create;
B.LoadFromResourceName(HInstance, 'NEWROW');
B.TransparentColor := clLime;
B.Transparent := True;
with Item as TNxMemoItem do
begin
for i := 0 to Lines.Count - 1 do
begin
DrawTextRect(Canvas, r, Lines[i]);
r.Left := r.Left + Canvas.TextWidth(Lines[i]) ;
if MultiLineSymbol and (i < Lines.Count - 1) then
begin
Canvas.Draw(r.Left, (r.Top + (r.Bottom - r.Top) div 2) - B.Height div 2, B ) ;
r.Left := r.Left + B.Width;
end;
r.Left := r.Left + 4;
if r.Left > ClientRect.Right then Exit; /// The "Exit" at this line keeps the bitmap from being freed
end;
end;
B.Free;
end;
begin
with Canvas do
begin
Font.Assign(Item.ValueFont);
if Item.Value = '' then
begin
Font.Color := clGrayText;
TGraphicsProvider.DrawTextRect(Canvas, GetTextRect, taLeftJustify, Item.EmptyValue, BiDiMode);
end else DrawLines;
end;
end;
/// change to this and the problem goes away
CODE
procedure TNxMemoItemDisplay.PaintValueData;
procedure DrawLines;
var
i: Integer;
r: TRect;
B: Graphics.TBitmap;
begin
r := GetTextRect;
B := Graphics.TBitmap.Create;
try /// added
B.LoadFromResourceName(HInstance, 'NEWROW');
B.TransparentColor := clLime;
B.Transparent := True;
with Item as TNxMemoItem do
begin
for i := 0 to Lines.Count - 1 do
begin
DrawTextRect(Canvas, r, Lines[i]);
r.Left := r.Left + Canvas.TextWidth(Lines[i]) ;
if MultiLineSymbol and (i < Lines.Count - 1) then
begin
Canvas.Draw(r.Left, (r.Top + (r.Bottom - r.Top) div 2) - B.Height div 2, B ) ;
r.Left := r.Left + B.Width;
end;
r.Left := r.Left + 4;
if r.Left > ClientRect.Right then Exit;
end;
end;
finally /// added
B.Free;
end; /// added
end;
begin
with Canvas do
begin
Font.Assign(Item.ValueFont);
if Item.Value = '' then
begin
Font.Color := clGrayText;
TGraphicsProvider.DrawTextRect(Canvas, GetTextRect, taLeftJustify, Item.EmptyValue, BiDiMode);
end else DrawLines;
end;
end;



Find content
Not Telling
