在窗体上放一imagelist,加入你要显示的image,设第1个是Openedico,第2个是
Closedico,(第0个随便是什么,取第0个好象有问题) ,把Stateimage指定为此
imagelist
然后在CustomDrawItem事件里添加代码:
procedure TForm1.TreeView1CustomDrawItem(Sender: TCustomTreeView;
Node: TTreeNode; State: TCustomDrawState; var DefaultDraw: Boolean);
begin
if Node.Expanded = True then
Node.StateIndex := 1
else
Node.StateIndex :=2;
end;