ArcGISCompare.frmMaster.lbDestinationValues_DrawItem C# (CSharp) Метод

lbDestinationValues_DrawItem() приватный Метод

private lbDestinationValues_DrawItem ( object sender, DrawItemEventArgs e ) : void
sender object
e DrawItemEventArgs
Результат void
        void lbDestinationValues_DrawItem(object sender, DrawItemEventArgs e)
        {
            if (e.Index >= 0)
            {
                ValueData ItemToAdd = (ValueData)lbDestinationValues.Items[e.Index];
                Color CurrentListColor = (ItemToAdd.numMappings > 0) ? Color.Blue : 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)lbDestinationValues.Items[e.Index].ToString()), this.Font, new SolidBrush(CurrentListColor), e.Bounds);
            }
        }