# C1.Win.SuperTooltip.C1SuperLabelBase.Measure

## Content

<div class="doc-site-dotnet-api-container">



<h1 id="C1_Win_SuperTooltip_C1SuperLabelBase_Measure_" data-uid="C1.Win.SuperTooltip.C1SuperLabelBase.Measure*">Measure Method
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="C1_Win_SuperTooltip_C1SuperLabelBase_Measure_" data-uid="C1.Win.SuperTooltip.C1SuperLabelBase.Measure*"></a>
<h4 id="C1_Win_SuperTooltip_C1SuperLabelBase_Measure" data-uid="C1.Win.SuperTooltip.C1SuperLabelBase.Measure">Measure()</h4>
<div class="markdown level1 summary"><p>Measures the width and height of the control content.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public Size Measure()</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Function Measure() As Size</code></pre>
</div>
<h5 class="returns">Returns</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.drawing.size">Size</a></td>
      <td><p><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.drawing.size">Size</a> object that represents the size of the content, in pixels.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 id="C1_Win_SuperTooltip_C1SuperLabelBase_Measure_examples">Examples</h5>
<p>The code below scans all the rows in a <b>C1FlexGrid</b> and calculates the width needed
to display the cell with the widest content:</p>
<pre><code class="lang-csharp">int GetMaximumCellWidth(int col)
{
  // maximum width is unknown
  int maxWidth = -1;

  // scan all rows to find the widest content
  for (int row = 0; row &lt; _flex.Rows.Count; row++)
  {
    // get cell content
    string text = _flex.GetDataDisplay(row, col);

    // check that the cell contains html
    if (!string.IsNullOrEmpty(text) &amp;&amp;
         text.StartsWith("&lt;html&gt;"))
    {
      // measure width needed to render the Html
      _superLabel.Text = text;
      int width = _superLabel.Measure().Width;

      // save maximum width
      if (width &gt; maxWidth)
        maxWidth = width;
  }
  return maxWidth;
}</code></pre>



<a id="C1_Win_SuperTooltip_C1SuperLabelBase_Measure_" data-uid="C1.Win.SuperTooltip.C1SuperLabelBase.Measure*"></a>
<h4 id="C1_Win_SuperTooltip_C1SuperLabelBase_Measure_System_Drawing_Graphics_" data-uid="C1.Win.SuperTooltip.C1SuperLabelBase.Measure(System.Drawing.Graphics)">Measure(Graphics)</h4>
<div class="markdown level1 summary"><p>Measures the width and height of the control content using specified <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.drawing.graphics">Graphics</a>.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public Size Measure(Graphics graphics)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Function Measure(graphics As Graphics) As Size</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Name</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.drawing.graphics">Graphics</a></td>
      <td><span class="parametername">graphics</span></td>
      <td><p><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.drawing.graphics">Graphics</a> used to measure.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 class="returns">Returns</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.drawing.size">Size</a></td>
      <td><p><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.drawing.size">Size</a> object that represents the size of the content, in pixels.</p>
</td>
    </tr>
  </tbody>
</table>


<a id="C1_Win_SuperTooltip_C1SuperLabelBase_Measure_" data-uid="C1.Win.SuperTooltip.C1SuperLabelBase.Measure*"></a>
<h4 id="C1_Win_SuperTooltip_C1SuperLabelBase_Measure_System_Int32_" data-uid="C1.Win.SuperTooltip.C1SuperLabelBase.Measure(System.Int32)">Measure(int)</h4>
<div class="markdown level1 summary"><p>Measures the height of the control content when rendered with a given width.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public Size Measure(int width)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Function Measure(width As Integer) As Size</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Name</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><span class="parametername">width</span></td>
      <td><p>Width used to calculate word-wrapping.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 class="returns">Returns</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.drawing.size">Size</a></td>
      <td><p><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.drawing.size">Size</a> object that represents the size of the content, in pixels.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 id="C1_Win_SuperTooltip_C1SuperLabelBase_Measure_System_Int32__examples">Examples</h5>
<p>The code below scans all the columns in a <b>C1FlexGrid</b> and calculates the height needed
to display the cell with the tallest content:</p>
<pre><code class="lang-csharp">int GetMaximumCellHeight(int row)
{
  // maximum height is unknown
  int maxHeight = -1;

  // scan all columns to find the tallest content
  for (int col = 0; col &lt; _flex.Cols.Count; col++)
  {
    // get cell content
    string text = _flex.GetDataDisplay(row, col);

    // check that the cell contains html
    if (!string.IsNullOrEmpty(text) &amp;&amp;
         text.StartsWith("&lt;html&gt;"))
    {
      // measure height needed to render the Html
      _superLabel.Text = text;
      int width = _flex.Cols[col].WidthDisplay;
      int height = _superLabel.Measure(width).Height;

      // save maximum height
      if (height &gt; maxHeight)
        maxHeight = height;
  }
  return maxHeight;
}</code></pre>



<a id="C1_Win_SuperTooltip_C1SuperLabelBase_Measure_" data-uid="C1.Win.SuperTooltip.C1SuperLabelBase.Measure*"></a>
<h4 id="C1_Win_SuperTooltip_C1SuperLabelBase_Measure_System_Drawing_Graphics_System_Int32_" data-uid="C1.Win.SuperTooltip.C1SuperLabelBase.Measure(System.Drawing.Graphics,System.Int32)">Measure(Graphics, int)</h4>
<div class="markdown level1 summary"><p>Measures the height of the control content using specified <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.drawing.graphics">Graphics</a> when rendered with a given width.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public Size Measure(Graphics graphics, int width)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Function Measure(graphics As Graphics, width As Integer) As Size</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Name</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.drawing.graphics">Graphics</a></td>
      <td><span class="parametername">graphics</span></td>
      <td><p><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.drawing.graphics">Graphics</a> used to measure.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
      <td><span class="parametername">width</span></td>
      <td><p>Width used to calculate word-wrapping.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 class="returns">Returns</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.drawing.size">Size</a></td>
      <td><p><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.drawing.size">Size</a> object that represents the size of the content, in pixels.</p>
</td>
    </tr>
  </tbody>
</table>
</div>
