Here's a picture of a System.Windows.Forms.ListView using LargeIcons
The selected item shows all it's text
e.g. The top left item shows only 11 characters of its name, it's shown fully if that's selected. How can I make it show all the text(or atleast more than 11 characters), for items that's not selected ?
There is DrawItem event http://msdn.microsoft.com/en-us/library/system.windows.forms.listview.drawitem.aspx. Inside this event you have access to System.Drawing.Graphics.DrawString method.
void view_DrawItem(object sender, DrawListViewItemEventArgs e)
{
e.Graphics.DrawString(e.Item.Text, drawFont, Brushes.Black,
new RectangleF(e.Item.Position.X,
e.Item.Position.Y,
20,
160));
}
I entered some values for width/height, but you should use MeasureString or similar method. Also do not forget to set OwnerDraw=true on ListView, otherwise it will not work.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With