# FarPoint.Win.FpProgress.GetPreferredSize

## Content

<div class="doc-site-dotnet-api-container">



<h1 id="FarPoint_Win_FpProgress_GetPreferredSize_" data-uid="FarPoint.Win.FpProgress.GetPreferredSize*">GetPreferredSize Method
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="FarPoint_Win_FpProgress_GetPreferredSize_" data-uid="FarPoint.Win.FpProgress.GetPreferredSize*"></a>
<h4 id="FarPoint_Win_FpProgress_GetPreferredSize_System_Drawing_Graphics_System_Drawing_Font_System_Int32_System_Int32_System_Int32_FarPoint_Win_ProgressOrientation_" data-uid="FarPoint.Win.FpProgress.GetPreferredSize(System.Drawing.Graphics,System.Drawing.Font,System.Int32,System.Int32,System.Int32,FarPoint.Win.ProgressOrientation)">GetPreferredSize(Graphics, Font, int, int, int, ProgressOrientation)</h4>
<div class="markdown level1 summary"><p>Calculates the height and width required to display the text and picture in the progress indicator.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public static Size GetPreferredSize(Graphics g, Font font, int value, int minimum, int maximum, ProgressOrientation orientation)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Shared Function GetPreferredSize(g As Graphics, font As Font, value As Integer, minimum As Integer, maximum As Integer, orientation As ProgressOrientation) 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">g</span></td>
      <td><p>GDI+ graphics surface</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.drawing.font">Font</a></td>
      <td><span class="parametername">font</span></td>
      <td><p>Font of text</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
      <td><span class="parametername">value</span></td>
      <td><p>Value</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
      <td><span class="parametername">minimum</span></td>
      <td><p>Minimum allowed value</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
      <td><span class="parametername">maximum</span></td>
      <td><p>Maximum allowed value</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="FarPoint.Win.ProgressOrientation.html">ProgressOrientation</a></td>
      <td><span class="parametername">orientation</span></td>
      <td><p>Orientation of the progress indicator</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>An ordered pair of type Size representing the width and height.</p>
</td>
    </tr>
  </tbody>
</table>


<a id="FarPoint_Win_FpProgress_GetPreferredSize_" data-uid="FarPoint.Win.FpProgress.GetPreferredSize*"></a>
<h4 id="FarPoint_Win_FpProgress_GetPreferredSize_System_Drawing_Graphics_System_Drawing_Font_System_Int32_System_Int32_System_Int32_FarPoint_Win_ProgressOrientation_FarPoint_Win_ProgressTextStyle_System_String_" data-uid="FarPoint.Win.FpProgress.GetPreferredSize(System.Drawing.Graphics,System.Drawing.Font,System.Int32,System.Int32,System.Int32,FarPoint.Win.ProgressOrientation,FarPoint.Win.ProgressTextStyle,System.String)">GetPreferredSize(Graphics, Font, int, int, int, ProgressOrientation, ProgressTextStyle, string)</h4>
<div class="markdown level1 summary"><p>Calculates the height and width required to display the text and picture in the progress indicator.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public static Size GetPreferredSize(Graphics g, Font font, int value, int minimum, int maximum, ProgressOrientation orientation, ProgressTextStyle textStyle, string textStr)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Shared Function GetPreferredSize(g As Graphics, font As Font, value As Integer, minimum As Integer, maximum As Integer, orientation As ProgressOrientation, textStyle As ProgressTextStyle, textStr As String) 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">g</span></td>
      <td><p>GDI+ graphics surface</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.drawing.font">Font</a></td>
      <td><span class="parametername">font</span></td>
      <td><p>Font of text</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
      <td><span class="parametername">value</span></td>
      <td><p>Value</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
      <td><span class="parametername">minimum</span></td>
      <td><p>Minimum allowed value</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
      <td><span class="parametername">maximum</span></td>
      <td><p>Maximum allowed value</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="FarPoint.Win.ProgressOrientation.html">ProgressOrientation</a></td>
      <td><span class="parametername">orientation</span></td>
      <td><p>Orientation of the progress indicator</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="FarPoint.Win.ProgressTextStyle.html">ProgressTextStyle</a></td>
      <td><span class="parametername">textStyle</span></td>
      <td><p>Determines what to display as the text</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></td>
      <td><span class="parametername">textStr</span></td>
      <td><p>Text string to display</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>An ordered pair of type Size representing the width and height.</p>
</td>
    </tr>
  </tbody>
</table>
</div>
