Set OwnerDraw=true;
Override DrawSubItem and DrawHeader
DrawHeader implement as e.DrawDefault=true
DrawSubItem implementation as:
if (e.ColumnIndex == 1)
{
e.DrawDefault = false;
e.DrawBackground();
int index = e.Item.ImageIndex;
Image img = imgLstWallHBState.Images[index];
e.Graphics.DrawImage(img, e.Bounds.Location);
}
else
{
e.DrawDefault = true;
}
Override DrawSubItem and DrawHeader
DrawHeader implement as e.DrawDefault=true
DrawSubItem implementation as:
if (e.ColumnIndex == 1)
{
e.DrawDefault = false;
e.DrawBackground();
int index = e.Item.ImageIndex;
Image img = imgLstWallHBState.Images[index];
e.Graphics.DrawImage(img, e.Bounds.Location);
}
else
{
e.DrawDefault = true;
}
No comments:
Post a Comment