uses CommCtrl;
var
ln: TTreeNode;
function NodeBold(node: TTreeNode; bld: Boolean): TTreeNode;
var
tvi: TTVItem;
begin
if node <> nil then begin
zeromemory(@tvi, SizeOf(tvi));
tvi.hItem := node.ItemID;
tvi.Mask := TVIF_STATE;
tvi.StateMask := TVIS_BOLD;
if bld then tvi.State := TVIS_BOLD
else tvi.State := 0;
TreeView_SetItem(node.Handle, tvi);
result := node;
end else result := nil;
end;
procedure TForm1.TreeView1Change(Sender: TObject; Node: TTreeNode);
begin
NodeBold(ln, FALSE);
ln := NodeBold(TreeView1.Selected, TRUE);
end;
procedure TForm1.FormShow(Sender: TObject);
begin
Treeview1.setfocus;
end;