private void cboDtl_DrawItem(object sender, DrawItemEventArgs e) { try { e.DrawBackground(); Brush codeBrush = Brushes.Black; string campaignName = String.Empty; int currentCampaignIndex = e.Index; ArrayList al = (ArrayList)cboDtlCampaign.DataSource; if ((al != null) && currentCampaignIndex >= 0) { if (someCondition) codeBrush = Brushes.Red; else codeBrush = Brushes.Green; } //Make the background color white so the colors stand out e.Graphics.DrawRectangle(new Pen(Color.White), e.Bounds); e.Graphics.FillRectangle(Brushes.White, e.Bounds); e.Graphics.DrawString(campaignName, e.Font, codeBrush, e.Bounds, StringFormat.GenericDefault); e.DrawFocusRectangle(); } catch { //just ignore it? } }
Powered by: newtelligence dasBlog 2.3.9074.18820
Disclaimer The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.
© Copyright 2012, © Copyright 2010
E-mail