procedure TForm1.TreeView1CustomDrawItem(Sender: TCustomTreeView;
Node: TTreeNode; State: TCustomDrawState; var DefaultDraw: Boolean);
var
DC: HDC;
OldFont: HFont;
rtNode: TRect;
i:integer;
begin
//주석을 풀면 선택된 노드의 색상이 변경된다.
//if cdsSelected in State then begin
{
for i:=0 to spSkinTreeView1.Items.Count -1 do
begin
DC := GetDC(Node.Handle);
oldFont := SelectObject(DC, TreeView1.Font.Handle);
if (i=2) or (i=4) then
SetTextColor(DC, clRed)
else
SetTextColor(DC, clBlack);
try
rtNode := TreeView1.Items.Item[i].DisplayRect(true);
TextOut(DC, rtNode.Left + 2, rtNode.Top + 1,
pChar(Node.Text), Length(Node.Text));
DefaultDraw := false;
finally
SelectObject(DC, OldFont);
ReleaseDC(Node.Handle, DC);
end;
end;
}
// end;
end;