Re: OwnerDraw ListView subitem problems
- From: "Jeff Gaines" <whitedragon@xxxxxxxxxxxxxxxxx>
- Date: Sun, 05 Oct 2008 04:33:21 -0700
On 05/10/2008 in message <eecpQpnJJHA.1556@xxxxxxxxxxxxxxxxxxxx> James wrote:
private void listView1_DrawSubItem(object sender, DrawListViewSubItemEventArgs e)
{
if (e.ColumnIndex == 1)
{
e.DrawBackground();
e.Graphics.DrawImage(e.Item.ImageList.Images[e.Item.ImageIndex], e.SubItem.Bounds.Location);
e.Graphics.DrawString(e.SubItem.Text, e.SubItem.Font, new SolidBrush(e.SubItem.ForeColor), e.SubItem.Bounds.Location.X + this.imageListTask.Images[0].Width, e.SubItem.Bounds.Location.Y);
}
}
I'm pretty sure I have sen this in another group.
Anyway, you always draw the sub-item in the same style from your code. If you want it to look different for different states you need to check its state and draw it accordingly.
--
Jeff Gaines Damerham Hampshire UK
It may be that your sole purpose in life is to serve as a warning to others.
.
- References:
- OwnerDraw ListView subitem problems
- From: James
- OwnerDraw ListView subitem problems
- Prev by Date: OwnerDraw ListView subitem problems
- Next by Date: Re: Textbox With Long Entry Displays Right-Most Part Rather Than Left-
- Previous by thread: OwnerDraw ListView subitem problems
- Next by thread: Re: Textbox With Long Entry Displays Right-Most Part Rather Than Left-
- Index(es):
Relevant Pages
|