procedure
TForm1.ListBox1DrawItem(Control: TWinControl; Index: Integer;
Rect: TRect; State: TOwnerDrawState);
begin
ListBox1.Canvas.FillRect(Rect); //Remplit
le rectangle spécifié du canevas avec le
pinceau en cours
ListBox1.Canvas.Font.Color:=clBlue; //Choix
de la couleur
ListBox1.Canvas.TextOut(Rect.Left, Rect.Top, ListBox1.Items[Index]);
//Ecrit une chaîne dans le
canevas aux coordonnées (X,Y)
end; |