Hi Nigel,
I must be missing something. I am manually inserting images to a TImageEnMView using SetIEBitmapEx. I am also defining each item by its ImageTag, hoping to have a different text color and background depending on the ImageTag value. But my whole application freezes when I do that. Where did I go wrong with the following OnGetTextEx code?
Thanks Nigel and sorry for being thick.
Andy
procedure TCompareForm.ImageEnMView1GetTextEx(Sender: TObject; Index: Integer;
Position: TIEMTextPos; var Text: WideString; Font: TFont;
var BackgroundStyle: TBrushStyle; var BackgroundColor: TColor;
var TruncSide: TIEMTruncSide);
begin
ImageEnMView1.BottomTextFont.Name := 'Arial Unicode MS';
ImageEnMView1.BottomTextFont.Size := 8;
ImageEnMView1.BottomTextFont.Style := [];
if (ImageEnMView1.ImageTag[ Index ] = 0) then begin
ImageEnMView1.TextBackgroundColor := clBtnFace;
ImageEnMView1.BottomTextFont.Color:=clBlack;
end else if (ImageEnMView1.ImageTag[ Index ] = 1) then begin
ImageEnMView1.TextBackgroundColor := clYellow;
ImageEnMView1.BottomTextFont.Color:=clBlue;
end else if (ImageEnMView1.ImageTag[ Index ] = 2) then begin
ImageEnMView1.TextBackgroundColor := clRed;
ImageEnMView1.BottomTextFont.Color:=clWhite;
end else if (ImageEnMView1.ImageTag[ Index ] = 3) then begin
ImageEnMView1.TextBackgroundColor := clBlue;
ImageEnMView1.BottomTextFont.Color:=clWhite;
end;
ImageEnMView1.Update;
end;