lw_common.ui.search_form.combo_DrawItem C# (CSharp) Méthode

combo_DrawItem() private méthode

private combo_DrawItem ( object sender, DrawItemEventArgs e ) : void
sender object
e System.Windows.Forms.DrawItemEventArgs
Résultat void
        private void combo_DrawItem(object sender, DrawItemEventArgs e) {
            Debug.Assert(e.Index >= 0);
            // Draw the background 
            e.DrawBackground();        

            // Get the item text    
            string text = ((ComboBox)sender).Items[e.Index].ToString();

            // Determine the forecolor based on whether or not the item is selected    
            Brush brush;
            if ( history_[e.Index].friendly_regex_name != "" )
                brush = Brushes.Red;
            else
                brush = Brushes.Black;

            bool italic = false;
            bool bold = history_[e.Index].last_view_names.Contains(lv_.name);

            // Draw the text    
            e.Graphics.DrawString(text, fonts_.get_font( ((Control)sender).Font, bold, italic, false), brush, e.Bounds.X, e.Bounds.Y);

        }