1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41
|
private void lvgantt_DrawSubItem(object sender, DrawListViewSubItemEventArgs e)
{
switch(e.Header.Text.ToUpper())
{
case "NAME":
{
e.DrawDefault = true; break;
}
default:
{
if (e.SubItem.Text.Equals(" "))
{
e.SubItem.Text = " ";
if (e.Item.Text.StartsWith(" "))
{
//e.SubItem.BackColor = Color.NavajoWhite;
e.Graphics.DrawImageUnscaledAndClipped(lvgantt.SmallImageList.Images["activate"], e.Bounds);
//DrawCenterImage(imageListPetiteTaille.Images["session"], e);
//DrawIcon(session, e.SubItem.Bounds);
}
else
{
//e.SubItem.BackColor = Color.Coral;
e.Graphics.DrawImageUnscaledAndClipped(imageListPetiteTaille.Images["activate"], e.Bounds);
//e.Graphics.DrawIcon(phase, e.SubItem.Bounds);
}
}
else if (e.SubItem.Text.Equals("today"))
{
e.SubItem.Text = " ";
//e.SubItem.BackColor = Color.SaddleBrown;
e.Graphics.DrawImageUnscaledAndClipped(imageListPetiteTaille.Images["session-today"], e.Bounds);
//DrawCenterImage(imageListPetiteTaille.Images["session-today"], e);
//e.Graphics.DrawIcon(session_today, e.SubItem.Bounds);
}
//else e.DrawDefault = true;
break;
}
}
} |
Partager