# FarPoint.Win.FpMultiOption.GetPreferredSize

## Content

<div class="doc-site-dotnet-api-container">



<h1 id="FarPoint_Win_FpMultiOption_GetPreferredSize_" data-uid="FarPoint.Win.FpMultiOption.GetPreferredSize*">GetPreferredSize Method
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="FarPoint_Win_FpMultiOption_GetPreferredSize_" data-uid="FarPoint.Win.FpMultiOption.GetPreferredSize*"></a>
<h4 id="FarPoint_Win_FpMultiOption_GetPreferredSize_System_Drawing_Graphics_System_Drawing_Font_FarPoint_Win_ButtonTextAlign_FarPoint_Win_RadioOrientation_FarPoint_Win_RadioPicture_System_Collections_ArrayList_" data-uid="FarPoint.Win.FpMultiOption.GetPreferredSize(System.Drawing.Graphics,System.Drawing.Font,FarPoint.Win.ButtonTextAlign,FarPoint.Win.RadioOrientation,FarPoint.Win.RadioPicture,System.Collections.ArrayList)">GetPreferredSize(Graphics, Font, ButtonTextAlign, RadioOrientation, RadioPicture, ArrayList)</h4>
<div class="markdown level1 summary"><p>Calculates the height and width required to display the text and picture
(of the option buttons) in the control with default width and height.</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, ButtonTextAlign nAlign, RadioOrientation nOrientation, RadioPicture radioPicture, ArrayList radioList)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Shared Function GetPreferredSize(g As Graphics, font As Font, nAlign As ButtonTextAlign, nOrientation As RadioOrientation, radioPicture As RadioPicture, radioList As ArrayList) 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</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="FarPoint.Win.ButtonTextAlign.html">ButtonTextAlign</a></td>
      <td><span class="parametername">nAlign</span></td>
      <td><p>Alignment of text</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="FarPoint.Win.RadioOrientation.html">RadioOrientation</a></td>
      <td><span class="parametername">nOrientation</span></td>
      <td><p>Orientation (vertical or horizontal) of list of option buttons</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="FarPoint.Win.RadioPicture.html">RadioPicture</a></td>
      <td><span class="parametername">radioPicture</span></td>
      <td><p>Picture (image) for the option buttons</p>
</td>
    </tr>
    <tr>
      <td><span class="xref">ArrayList</span></td>
      <td><span class="parametername">radioList</span></td>
      <td><p>Array of list of options</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_FpMultiOption_GetPreferredSize_" data-uid="FarPoint.Win.FpMultiOption.GetPreferredSize*"></a>
<h4 id="FarPoint_Win_FpMultiOption_GetPreferredSize_System_Drawing_Graphics_System_Drawing_Font_FarPoint_Win_ButtonTextAlign_FarPoint_Win_RadioOrientation_FarPoint_Win_RadioPicture_System_Collections_ArrayList_System_Int32_System_Int32_System_Boolean_" data-uid="FarPoint.Win.FpMultiOption.GetPreferredSize(System.Drawing.Graphics,System.Drawing.Font,FarPoint.Win.ButtonTextAlign,FarPoint.Win.RadioOrientation,FarPoint.Win.RadioPicture,System.Collections.ArrayList,System.Int32,System.Int32,System.Boolean)">GetPreferredSize(Graphics, Font, ButtonTextAlign, RadioOrientation, RadioPicture, ArrayList, int, int, bool)</h4>
<div class="markdown level1 summary"><p>Calculates the height and width required to display the text and picture
(of the option buttons) in the control.</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, ButtonTextAlign nAlign, RadioOrientation nOrientation, RadioPicture radioPicture, ArrayList radioList, int pictWidth, int pictHeight, bool compact = false)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Shared Function GetPreferredSize(g As Graphics, font As Font, nAlign As ButtonTextAlign, nOrientation As RadioOrientation, radioPicture As RadioPicture, radioList As ArrayList, pictWidth As Integer, pictHeight As Integer, Optional compact As Boolean = False) 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</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="FarPoint.Win.ButtonTextAlign.html">ButtonTextAlign</a></td>
      <td><span class="parametername">nAlign</span></td>
      <td><p>Alignment of text</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="FarPoint.Win.RadioOrientation.html">RadioOrientation</a></td>
      <td><span class="parametername">nOrientation</span></td>
      <td><p>Orientation (vertical or horizontal) of list of option buttons</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="FarPoint.Win.RadioPicture.html">RadioPicture</a></td>
      <td><span class="parametername">radioPicture</span></td>
      <td><p>Picture (image) for the option buttons</p>
</td>
    </tr>
    <tr>
      <td><span class="xref">ArrayList</span></td>
      <td><span class="parametername">radioList</span></td>
      <td><p>Array of list of options</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
      <td><span class="parametername">pictWidth</span></td>
      <td><p>Width of picture for the option buttons</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
      <td><span class="parametername">pictHeight</span></td>
      <td><p>Height of picture for the option buttons</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.boolean">bool</a></td>
      <td><span class="parametername">compact</span></td>
      <td><p>Indicating whether the button shows in compact mode</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>
