# GrapeCity.Wpf.SpreadSheet.CellType.Editors.GcTextBox.MaxLines

## Content

<div class="doc-site-dotnet-api-container">



<h1 id="GrapeCity_Wpf_SpreadSheet_CellType_Editors_GcTextBox_MaxLines_" data-uid="GrapeCity.Wpf.SpreadSheet.CellType.Editors.GcTextBox.MaxLines*">MaxLines Property
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="GrapeCity_Wpf_SpreadSheet_CellType_Editors_GcTextBox_MaxLines_" data-uid="GrapeCity.Wpf.SpreadSheet.CellType.Editors.GcTextBox.MaxLines*"></a>
<h4 id="GrapeCity_Wpf_SpreadSheet_CellType_Editors_GcTextBox_MaxLines" data-uid="GrapeCity.Wpf.SpreadSheet.CellType.Editors.GcTextBox.MaxLines">MaxLines</h4>
<div class="markdown level1 summary"><p>Gets or sets the maximum number of visible lines. This is a dependency property.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public int MaxLines { get; set; }</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Property MaxLines As Integer</code></pre>
</div>
<h5 class="propertyValue">Property Value</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
      <td><p>The maximum number of visible lines. The default is <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32.maxvalue">MaxValue</a>.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 id="GrapeCity_Wpf_SpreadSheet_CellType_Editors_GcTextBox_MaxLines_remarks">Remarks</h5>
<div class="markdown level1 remarks"><p>
        Getting this property returns the current value of <a class="xref" href="GrapeCity.Wpf.SpreadSheet.CellType.Editors.GcTextBox.MaxLines.html#GrapeCity_Wpf_SpreadSheet_CellType_Editors_GcTextBox_MaxLines">MaxLines</a>. Setting this property causes the text box to resize if the number of visible lines exceeds the limit specified by <a class="xref" href="GrapeCity.Wpf.SpreadSheet.CellType.Editors.GcTextBox.MaxLines.html#GrapeCity_Wpf_SpreadSheet_CellType_Editors_GcTextBox_MaxLines">MaxLines</a>.
      </p>
<p>
        This property applies only to visible lines, and does not constrain the actual number of lines. Depending on its configuration, a text box may contain additional non-visible lines that are accessible by scrolling.
      </p>
<p>
        If the <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.windows.frameworkelement.height">Height</a> property is explicitly set on a <a class="xref" href="GrapeCity.Wpf.SpreadSheet.CellType.Editors.GcTextBox.html">GcTextBox</a>, the <a class="xref" href="GrapeCity.Wpf.SpreadSheet.CellType.Editors.GcTextBox.MaxLines.html#GrapeCity_Wpf_SpreadSheet_CellType_Editors_GcTextBox_MaxLines">MaxLines</a> and <a class="xref" href="GrapeCity.Wpf.SpreadSheet.CellType.Editors.GcTextBox.MinLines.html#GrapeCity_Wpf_SpreadSheet_CellType_Editors_GcTextBox_MinLines">MinLines</a> property values are ignored.
      </p>
</div>
<h5 class="exceptions">Exceptions</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Condition</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.exception">Exception</a></td>
      <td><p><a class="xref" href="GrapeCity.Wpf.SpreadSheet.CellType.Editors.GcTextBox.MaxLines.html#GrapeCity_Wpf_SpreadSheet_CellType_Editors_GcTextBox_MaxLines">MaxLines</a> is less than <a class="xref" href="GrapeCity.Wpf.SpreadSheet.CellType.Editors.GcTextBox.MinLines.html#GrapeCity_Wpf_SpreadSheet_CellType_Editors_GcTextBox_MinLines">MinLines</a>.</p>
</td>
    </tr>
  </tbody>
</table>
</div>
