Using an array to hold the listbox items' status is not a great idea because if you added sorting to the listbox, the listbox items and array could become unsyncronised.
I've gone about things a bit differently, using a simple object to hold the company name as well as it's status so that the 2 items are always together, thus avoiding any unwanted (and unnecessary) complications:
Code:
using System;
using System.Drawing;
using System.Windows.Forms;
namespace WindowsFormsApplication1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
listBox1.DrawMode = DrawMode.OwnerDrawFixed;
listBox1.DrawItem += new DrawItemEventHandler(listBox1_DrawItem);
listBox1.Items.Add(new MyObject("ABC Company", Status.Normal));
listBox1.Items.Add(new MyObject("DEF Company", Status.Active));
listBox1.Items.Add(new MyObject("GHI Company", Status.Active));
listBox1.Items.Add(new MyObject("JKL Company", Status.Other));
listBox1.Items.Add(new MyObject("MNO Company", Status.Normal));
}
private void listBox1_DrawItem(object sender, DrawItemEventArgs e)
{
Color fore;
MyObject obj = (MyObject)this.listBox1.Items[e.Index];
switch (obj.status)
{
case Status.Active: // active
fore = Color.Red;
break;
case Status.Normal: // normal
fore = Color.Blue;
break;
default: // other
fore = Color.Gray;
break;
}
e.Graphics.DrawString(obj.company, e.Font, new SolidBrush(fore), new PointF(e.Bounds.X, e.Bounds.Y));
}
}
public enum Status
{
Active = 0,
Normal = 1,
Other = 2
}
class MyObject
{
public Status status;
public String company;
public MyObject() { }
public MyObject(String company, Status status)
{
this.company = company;
this.status = status;
}
}
}