143 lines
6.3 KiB
HTML
143 lines
6.3 KiB
HTML
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||
<head>
|
||
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
|
||
<title>Multi-line Items</title>
|
||
<link href="style.css" rel="stylesheet" type="text/css">
|
||
<link href="prettify.css" type="text/css" rel="stylesheet">
|
||
<script type="text/javascript" src="prettify.js"></script><script type="text/javascript" src="lang-vb.js"></script><link href="../resources/main.css" media="screen" rel="stylesheet" type="text/css">
|
||
</head>
|
||
<body onload="prettyPrint()"><div class="placing">
|
||
<br><table class="navigation"><tr>
|
||
<td class="navigation-previous"><a href="chapter-layout.html"><strong>
|
||
« Layout Properties</strong></a></td>
|
||
<td class="navigation-index"><a href="../../../quick-start-guide/better-listview/index.html"><strong>Index</strong></a></td>
|
||
<td class="navigation-next"><a href="chapter-owner-draw.html"><strong>Owner Drawing »
|
||
</strong></a></td>
|
||
</tr></table>
|
||
<br><h1>Multi-line Items</h1>
|
||
<div class="banner">
|
||
<a href="../../../blog/page/6/index.html"><img src="../resources/overview.gif" alt="Better ListView" class="ss"></a>
|
||
<div class="inside">
|
||
<div class="text">Better ListView: Ultimate .NET ListView replacement control for WinForms (C#, VB.NET)</div>
|
||
<span class="dbtn-c dbtn-hilight"><span class="dbtn-w"><a href="../../../betterlistview.exe" class="dbtn">Download</a></span></span>
|
||
<span class="dbtn-c"><span class="dbtn-w"><a href="../../../blog/page/6/index.html" class="dbtn">More Info</a></span></span>
|
||
</div>
|
||
</div>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<h2>Setting Up Multi-line Items and Column Headers</h2>
|
||
|
||
|
||
<p>Better ListView holds a property called
|
||
<span class="code">MaximumTextLines</span> for each view. This property specifies
|
||
maximum number of lines that can be displayed in column header, item or
|
||
sub-item. You can access this property via the corresponding
|
||
layout:</p>
|
||
|
||
<ul>
|
||
<li>
|
||
<p><span class="code">LayoutColumns</span></p>
|
||
</li>
|
||
<li>
|
||
<p><span class="code">LayoutItemsCurrent</span></p>
|
||
</li>
|
||
<li>
|
||
<p><span class="code">LayoutItemsLargeIcon</span>, <span class="code">LayoutItemsList</span>,
|
||
etc.</p>
|
||
</li>
|
||
</ul>
|
||
<p>For example, if you set <span class="code">LayoutColumns.MaximumTextLines</span>
|
||
and <span class="code">LayoutItemsDetailsColumns.MaximumTextLines</span> to
|
||
<span class="code">3</span>, the items and sub-items in the
|
||
<strong><em>Details</em></strong> view with columns will have up to three
|
||
lines:</p>
|
||
|
||
<p class="images"><img src="layout-multiline1.png"><img src="layout-multiline2.png"></p>
|
||
|
||
<p>You can also specifiy maximum allowed number of text lines for a
|
||
(sub)item by setting one of the following properties:</p>
|
||
|
||
<ul>
|
||
<li>
|
||
<p><span class="code">BetterListViewItems.MaximumTextLines</span></p>
|
||
</li>
|
||
<li>
|
||
<p><span class="code">BetterListViewSubItem.MaximumTextLines</span></p>
|
||
</li>
|
||
</ul>
|
||
<h2>Multi-line Groups</h2>
|
||
|
||
|
||
<p>Groups can contain multi-line text as well.</p>
|
||
|
||
<p>However, group layouts do not have a <span class="code">MaximumTextLines</span>
|
||
property because there are no text wrapping options available. When group
|
||
gets too short, each line of the text gets trimmed separately (this works
|
||
the same way for items, when <span class="code">TextWrapping</span> property is set to
|
||
<span class="code">None</span> and item contains multi-line text. See <strong><em><a href="chapter-multi-line.html#adjusting-text-wrapping">Adjusting Text
|
||
Wrapping</a></em></strong>):</p>
|
||
|
||
<p class="images"><img src="multi-line-groups.png"></p>
|
||
|
||
|
||
<h2>Text with Newline Characters</h2>
|
||
|
||
|
||
<p>Better ListView supports text with multiple lines by default. Better
|
||
ListView recognizes <strong><em>LF</em></strong> characters as newlines, while
|
||
ingoring the <strong><em>CR</em></strong> characters, so you can use either
|
||
<strong><em>LF</em></strong> or <strong><em>CRLF</em></strong> as a newline
|
||
mark.</p>
|
||
|
||
<p>By default, only the first line of the text is displayed, so set the
|
||
<span class="code">MaximumTextLines</span> property to a number of lines you wish to
|
||
display.</p>
|
||
|
||
|
||
<h2>
|
||
<a name="adjusting-text-wrapping" id="adjusting-text-wrapping"></a>Adjusting Text
|
||
Wrapping</h2>
|
||
|
||
|
||
<p>Multi-line items gets higher when more space is needed for more
|
||
lines. Item height is controlled by the MaximumTextLines property, but you
|
||
may want to keep some sub-items on single line (e.g. sub-item displaying
|
||
date), or wrap the text, but only in the available space:</p>
|
||
|
||
<p class="images"><img src="text-formatting-wrap.png"></p>
|
||
|
||
<p>To control text wrapping behavior, use the
|
||
<span class="code">BetterListViewSubItem.TextWrapping</span> (or
|
||
<span class="code">BetterListViewItem.TextWrapping</span>) property. See <strong><em><a href="chapter-text-formatting.html#text-wrapping">Text
|
||
Wrapping</a></em></strong> for more informaton.</p>
|
||
|
||
<br><div class="banner">
|
||
<a href="../../../blog/page/6/index.html"><img src="../resources/overview.gif" alt="Better ListView" class="ss"></a>
|
||
<div class="inside">
|
||
<div class="text">Better ListView: Ultimate .NET ListView replacement control for WinForms (C#, VB.NET)</div>
|
||
<span class="dbtn-c dbtn-hilight"><span class="dbtn-w"><a href="../../../betterlistview.exe" class="dbtn">Download</a></span></span>
|
||
<span class="dbtn-c"><span class="dbtn-w"><a href="../../../blog/page/6/index.html" class="dbtn">More Info</a></span></span>
|
||
</div>
|
||
</div>
|
||
<table class="navigation"><tr>
|
||
<td class="navigation-previous"><a href="chapter-layout.html"><strong>
|
||
« Layout Properties</strong></a></td>
|
||
<td class="navigation-index"><a href="../../../quick-start-guide/better-listview/index.html"><strong>Index</strong></a></td>
|
||
<td class="navigation-next"><a href="chapter-owner-draw.html"><strong>Owner Drawing »
|
||
</strong></a></td>
|
||
</tr></table>
|
||
<br><table class="footer"><tr>
|
||
<td class="footer-title">Better ListView Documentation
|
||
</td>
|
||
<td class="footer-copyright">
|
||
Copyright © 2010-2012 <a href="../../../index.html" target="_blank">ComponentOwl.com</a>
|
||
</td>
|
||
</tr></table>
|
||
</div></body>
|
||
</html>
|