I have a problem with function "listView1_DrawSubItem". I change only second column, because I have to put some image in second column. Problem is with FONT. When I draw second column font is more sharp than in first column. What is amazing it appears only when I first open Chart form. As it is show in code first column is drawinng by default, second column is drawing by me.
There is an image of this. Watch it on full resolution.
Here is my code:
fo is my Font which I can change.
private void listView1_DrawSubItem(object sender, DrawListViewSubItemEventArgs e)
{
if (e.Header != this.columnHeader2)
{
e.DrawDefault = true;
return;
}
if (e.Item.SubItems[1].Text == "1")
{
e.DrawBackground();
e.Graphics.DrawImage(Properties.Resources.Blank_Badge_Green, e.SubItem.Bounds.Location.X, e.SubItem.Bounds.Location.Y, 10, 10);
}
else if (e.Item.SubItems[1].Text == "0")
{
e.DrawBackground();
e.Graphics.DrawImage(Properties.Resources.Blank_Badge_Grey, e.SubItem.Bounds.Location.X, e.SubItem.Bounds.Location.Y, 10, 10);
}
else
{
e.DrawBackground();
e.Graphics.DrawString(e.SubItem.Text, fo, new SolidBrush(e.SubItem.ForeColor), e.SubItem.Bounds.Location.X, e.SubItem.Bounds.Location.Y);
}
}
private void listView1_DrawColumnHeader(object sender, DrawListViewColumnHeaderEventArgs e)
{
e.DrawDefault = true;
}