Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre questionthis.Cbb1.DrawMode = DrawMode.OwnerDrawFixed; this.Cbb1.Items.AddRange(Nationalité_Liste); this.Cbb1.ItemHeight = 18; this.Cbb1.DrawItem += new DrawItemEventHandler(this.Cbb1_DrawItem);
protected void Cbb_DrawItem(object sender, DrawItemEventArgs e) { e.DrawBackground(); Font myFont = new Font("Tahoma", 8 , FontStyle.Regular, GraphicsUnit.Point, ((Byte) (0)) ); e.Graphics.DrawString(Nationalité_Liste[e.Index]), myFont, Brushes.Black, new Rectangle(e.Bounds.X+36, e.Bounds.Y+3, 90, 16)); Image drapeau = imageList2.Images[e.Index-1]; e.Graphics.DrawImage(drapeau, new Rectangle(e.Bounds.X+2, e.Bounds.Y+1, 32, 16)); e.DrawFocusRectangle(); }