设置树TreeViewNode 颜色问题
树TreeViewNode
INode1=TreeViewNode->Items->AddChild(NULL,"未出");
INode2=TreeViewNode->Items->AddChild(NULL,"暂缓");
.....
怎么对个列设置上不同颜色? 如 ,"未出" 设置成红色 ,"暂缓" 设置成蓝色.谢谢!
[解决办法]
TreeViewNode应该类似吧
void __fastcall TForm1::TreeView1CustomDrawItem( TCustomTreeView *Sender, TTreeNode *Node, TCustomDrawState State, bool &DefaultDraw){ String text; text = Node->Text; if( text.Pos("有档") ) { TreeView1->Canvas->Font->Color=clRed; } else { TreeView1->Canvas->Font->Color=clBlue; }}