Getting an image from an image list

>I am trying to get an image from an image list to be displated next to an
>item on a TTreeView but I just can't seem to work it out.

I gather you've got the images property of the TTreeView set to your
imagelist. The following is the sort of thing I've done and it works.

      thisNode :=  TV.items.AddChildObject(refNode, SearchRec.Name, pData);
      thisNode.ImageIndex := 1;
      thisNode.SelectedIndex := 1;
 

procedure TForm1.TVCollapsing(Sender: TObject; Node: TTreeNode;
  var AllowCollapse: Boolean);
begin
  Node.ImageIndex := 0;
  Node.SelectedIndex := 0;
end;

procedure TForm1.TVExpanding(Sender: TObject; Node: TTreeNode;
  var AllowExpansion: Boolean);
begin
  Node.ImageIndex := 4;
  Node.SelectedIndex := 4;
end;
----------