displaying many lines in ListView

  • Thread starter Piotrek Stachowicz
  • Start date
P

Piotrek Stachowicz

Hello,
Is there possibility to display many lines of text in a single item (in
ListView)? I'd like the text to wrap. I must use View.Details mode.

If so, how?!
Thx

Piotrek
 
S

Shakir Hussain

In details mode, it wont be possible to make the text wrap in the .NET
listview. Becoz listview shows only ColumnHeaders to resize. There is no row
headers available. The row height will be automatically determined by the
Fontsize of the control.

You can show the tooltip if the text overflows during mouse hover.
 
P

Piotrek Stachowicz

[cut]
You can show the tooltip if the text overflows during mouse hover.

Hi,
Tooltip would be quite a good idea if it weren't for the fact that I 'd
have to associate with ListViewItem, rather than control. Any suggestions
how to do this?

Piotrek
 
S

Shakir Hussain

Piotrek,

You have to set the tooltip for control, but the messages will change
dynamically based on users mouse move

The following code demonstrates showing tool tip for first column which
always has text overflown during mousemove of listview.

private void listView1_MouseMove(object sender,
System.Windows.Forms.MouseEventArgs e)
{
ListViewItem item = listView1.GetItemAt(e.X,e.Y);

if(item != null)
{
if(item.Text != "")
{
this.myToolTip.SetToolTip(listView1,item.Text);
}
else
{
this.myToolTip.RemoveAll();
}
}
else
{
this.myToolTip.RemoveAll();
}
}


--
Shak
(Houston)




Piotrek Stachowicz said:
[cut]
You can show the tooltip if the text overflows during mouse hover.

Hi,
Tooltip would be quite a good idea if it weren't for the fact that I 'd
have to associate with ListViewItem, rather than control. Any suggestions
how to do this?

Piotrek
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top