void lbDestAttributes_DrawItem(object sender, DrawItemEventArgs e)
{
Color CurrentListColor = Color.Black;
if (e.Index >= 0)
{
AttributeData ItemToAdd = (AttributeData)lbDestAttributes.Items[e.Index];
if (ItemToAdd.numMappings > 0) { CurrentListColor = Color.Blue; }
else if (ItemToAdd.usesConstant) { CurrentListColor = Color.Green; }
else if (ItemToAdd.recordCount > 0) { CurrentListColor = Color.Red; }
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)lbDestAttributes.Items[e.Index].ToString()), this.Font, new SolidBrush(CurrentListColor), e.Bounds);
}
}