System.Windows.Forms.ThemeWin32Classic.DrawListBoxItem C# (CSharp) Method

DrawListBoxItem() public method

public DrawListBoxItem ( ListBox ctrl, DrawItemEventArgs e ) : void
ctrl ListBox
e DrawItemEventArgs
return void
		public override void DrawListBoxItem (ListBox ctrl, DrawItemEventArgs e)
		{
			Color back_color, fore_color;
			
			if ((e.State & DrawItemState.Selected) == DrawItemState.Selected) {
				back_color = ColorHighlight;
				fore_color = ColorHighlightText;
			} else {
				back_color = e.BackColor;
				fore_color = e.ForeColor;
			}

			e.Graphics.FillRectangle (ResPool.GetSolidBrush (back_color), e.Bounds);

			e.Graphics.DrawString (ctrl.GetItemText (ctrl.Items[e.Index]), e.Font,
					       ResPool.GetSolidBrush (fore_color),
					       e.Bounds, ctrl.StringFormat);
					
			if ((e.State & DrawItemState.Focus) == DrawItemState.Focus)
				CPDrawFocusRectangle (e.Graphics, e.Bounds, fore_color, back_color);
		}
		
ThemeWin32Classic