Comment afficher une couleur de fond différente à chaque ligne d'un combo??
Comment afficher une couleur de fond différente à chaque ligne d'un combo??
Bonjours j'ai deja repondu plusieur fois a ce genre de probleme
Il te suffit alors de changer la couleur en fonction de index pair ou impaire ....
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 void __fastcall TForm4::ComboBox1DrawItem(TWinControl *Control, int Index, TRect &Rect, TOwnerDrawState State) { char st[256]; using Graphics::TBitmap; int var; TRect MyRect, MyRect2; MyRect.Left=0; MyRect.Right=30; MyRect.Top=0; MyRect.Bottom=14; ComboBox1->Canvas->Brush->Color = clWhite; ComboBox1->Canvas->FillRect(Rect); ComboBox1->Canvas->Font->Color = clBlack; ComboBox1->Canvas->TextOut(Rect.Left+40 , Rect.Top, ComboBox1->Items->Strings[Index]);}
Derain didier
gracie mille, j'ai enfin compris conceptuellement le process!!
je mettre résolu the thread!
Partager