private void ListTab_DrawItem(object sender, DrawItemEventArgs e)
{
string txt;
try
{
txt = ListTab.TabPages[e.Index].Text;
}
catch (Exception)
{
return;
}
e.Graphics.FillRectangle(System.Drawing.SystemBrushes.Control, e.Bounds);
if (e.State == DrawItemState.Selected)
{
e.DrawFocusRectangle();
}
Brush fore;
try
{
if (_statuses.Tabs[txt].UnreadCount > 0)
fore = Brushes.Red;
else
fore = System.Drawing.SystemBrushes.ControlText;
}
catch (Exception)
{
fore = System.Drawing.SystemBrushes.ControlText;
}
e.Graphics.DrawString(txt, e.Font, fore, e.Bounds, sfTab);
}