Владимир
Группа: Администратор
Сообщений: 1190
|
CODE |
for(int i=0; i<FileListBox1->Items->Count; i++){
TRect R = FileListBox1->ItemRect(i);
AnsiString sf = FileListBox1->Items->Strings[i];
FileListBox1->Canvas->FillRect(R);
if(sf.Pos(".doc")) FileListBox1->Canvas->Brush->Color = clYellow;
else if(sf.Pos(".exe")) FileListBox1->Canvas->Brush->Color = clRed;
else if(sf.Pos(".cpp")) FileListBox1->Canvas->Brush->Color = clBlue;
else if(sf.Pos(".txt")) FileListBox1->Canvas->Brush->Color = clGreen;
else FileListBox1->Canvas->Brush->Color = clWhite;
FileListBox1->Canvas->Font->Color = clBlack;
FileListBox1->Canvas->TextRect(R,R.Left+2,R.Top+2, sf);
}
|
|