ListView row height and custom text

  • Thread starter Thread starter Christopher Beltran
  • Start date Start date
C

Christopher Beltran

I am working with the ListView control and I only seem to
be able to place regular text in each cell. I would like
to place say a paragraph of text (that does not require
the user to lengthen the column width), basically a word-
wrap function inside a cell. I cannot seem to be able to
place say a label control into a ListViewItem. Does
anyone know if you can place controls other than text
strings into a listview item or if there's an easy way to
make column widths word-wrap instead of requiring resizing?

Thanks so much!
 
Hi Christopher,

Thank you for the question. The ListView control will only allow you to
add text items, and in some cases associate an icon with the text (for
example, with 'LargeIcon' view).
Also, if you set your View property to 'LargeIcon', then you can set the
LabelWrap property to true, which will cause the text to wrap for a
particular item.

One thing you might consider is handling the ItemActivate event and in the
handler you can determine if your text is too large to fit in the cell, and
if so, resize the column that the item is in.

Hope this helps.

Thanks,
Rick [MSFT]

This posting is provided "AS IS", with no warranties, and confers no rights.

--------------------
| Content-Class: urn:content-classes:message
| From: "Christopher Beltran" <[email protected]>
| Sender: "Christopher Beltran" <[email protected]>
| Subject: ListView row height and custom text
| Date: Thu, 23 Oct 2003 12:37:42 -0700
| Lines: 11
| Message-ID: <[email protected]>
| MIME-Version: 1.0
| Content-Type: text/plain;
| charset="iso-8859-1"
| Content-Transfer-Encoding: 7bit
| X-Newsreader: Microsoft CDO for Windows 2000
| Thread-Index: AcOZnSA/1kYO5uIvRqKmLqxQ0ZEw4w==
| X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300
| Newsgroups: microsoft.public.dotnet.framework.windowsforms
| Path: cpmsftngxa06.phx.gbl
| Xref: cpmsftngxa06.phx.gbl
microsoft.public.dotnet.framework.windowsforms:55121
| NNTP-Posting-Host: TK2MSFTNGXA13 10.40.1.165
| X-Tomcat-NG: microsoft.public.dotnet.framework.windowsforms
|
| I am working with the ListView control and I only seem to
| be able to place regular text in each cell. I would like
| to place say a paragraph of text (that does not require
| the user to lengthen the column width), basically a word-
| wrap function inside a cell. I cannot seem to be able to
| place say a label control into a ListViewItem. Does
| anyone know if you can place controls other than text
| strings into a listview item or if there's an easy way to
| make column widths word-wrap instead of requiring resizing?
|
| Thanks so much!
|
 
Back
Top