ArcGISCompare.frmMaster.lbDestination_DrawItem C# (CSharp) Method

lbDestination_DrawItem() private method

private lbDestination_DrawItem ( object Sender, DrawItemEventArgs e ) : void
Sender object
e DrawItemEventArgs
return void
        private void lbDestination_DrawItem(object Sender, DrawItemEventArgs e)
        {
            Color CurrentListColor = Color.Brown;
            if (e.Index >= 0)
            {
                FeatureData ItemToAdd = (FeatureData)lbDestination.Items[e.Index];
                if (ItemToAdd.isIdentical == 1) { CurrentListColor = Color.Black; }
                e.DrawBackground();

                if ((e.State & DrawItemState.Selected) == DrawItemState.Selected)
                {
                    Graphics g = e.Graphics;
                    g.FillRectangle(new SolidBrush(Color.Silver), e.Bounds);
                }

                e.DrawFocusRectangle();
                e.Graphics.DrawString(((String)lbDestination.Items[e.Index].ToString()), this.Font, new SolidBrush(CurrentListColor), e.Bounds);
            }
        }