ListBox einträge farbig machen.
-
Hallo,
weiß jemand wie ich :
ListBox1->Items->Strings[i] = "Fehler: Socket konnte nicht erstellt werden";machen kann das der String also:
Fehler: Socket konnte nicht erstellt werden Rot eingetargen wird ?!??
-
ich meine sowas:
ListBox1->Items->Add("Verbindung zu localhost!");
-
void __fastcall TForm1::Button1Click(TObject *Sender) { ListBox1->Items->Add("lalala"); Index = ListBox1->Items->IndexOf("lalala"); Index++; }void __fastcall TForm1::ListBox1DrawItem(TWinControl *Control, int Index, TRect &Rect, TOwnerDrawState State) { if (Index == 0) ListBox1->Canvas->Font->Color = clBlue; if (Index == 1) ListBox1->Canvas->Font->Color = clRed; if (Index == 2) ListBox1->Canvas->Font->Color = clGreen; ListBox1->Canvas->TextRect(Rect, Rect.Left, Rect.Top,ListBox1->Items->Strings[Index]); }mfg.
-
würde auch mal jemand die FAQ lesen?