# C1.Win.FlexGrid.Util.BaseControls.ScrollableControl.ScrollBars

## Content

<div class="doc-site-dotnet-api-container">



<h1 id="C1_Win_FlexGrid_Util_BaseControls_ScrollableControl_ScrollBars_" data-uid="C1.Win.FlexGrid.Util.BaseControls.ScrollableControl.ScrollBars*">ScrollBars Property
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="C1_Win_FlexGrid_Util_BaseControls_ScrollableControl_ScrollBars_" data-uid="C1.Win.FlexGrid.Util.BaseControls.ScrollableControl.ScrollBars*"></a>
<h4 id="C1_Win_FlexGrid_Util_BaseControls_ScrollableControl_ScrollBars" data-uid="C1.Win.FlexGrid.Util.BaseControls.ScrollableControl.ScrollBars">ScrollBars</h4>
<div class="markdown level1 summary"><p>Gets or sets which scroll bars should appear on 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 ScrollBars ScrollBars { get; set; }</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Property ScrollBars As ScrollBars</code></pre>
</div>
<h5 id="C1_Win_FlexGrid_Util_BaseControls_ScrollableControl_ScrollBars_remarks">Remarks</h5>
<div class="markdown level1 remarks"><p>Scroll bars are displayed only if the contents of the control extend beyond its 
client area. For example, if <a class="xref" href="C1.Win.FlexGrid.Util.BaseControls.ScrollableControl.ScrollBars.html#C1_Win_FlexGrid_Util_BaseControls_ScrollableControl_ScrollBars">ScrollBars</a> is set to <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.windows.forms.scrollbars#system-windows-forms-scrollbars-horizontal">Horizontal</a>, 
a horizontal scroll bar is displayed only if the control is not wide enough to display all 
columns at once.</p>
<p>Even when it has no scrollbars, the control will still scroll to keep the selection visible. 
If you want to prevent scrolling, handle the <a class="xref" href="C1.Win.FlexGrid.C1FlexGridBase.BeforeScroll.html">BeforeScroll</a> event and 
set its <a class="xref" href="C1.Win.FlexGrid.RangeEventArgs.Cancel.html#C1_Win_FlexGrid_RangeEventArgs_Cancel">Cancel</a> parameter to true.</p>
<p>You can force the control to display scrollbars at all times with the 
<span class="xref">C1.Win.FlexGrid.Util.BaseControls.ScrollableControl.ForceScrollBars</span> property.</p>
<p>You can determine which scrollbars are currently visible with the 
<a class="xref" href="C1.Win.FlexGrid.Util.BaseControls.ScrollableControl.ScrollBarsVisible.html#C1_Win_FlexGrid_Util_BaseControls_ScrollableControl_ScrollBarsVisible">ScrollBarsVisible</a> property.</p>
</div>
<h5 id="C1_Win_FlexGrid_Util_BaseControls_ScrollableControl_ScrollBars_seealso">See Also</h5>
<div class="seealso">
    <div><a class="xref" href="C1.Win.FlexGrid.Util.BaseControls.ScrollableControl.ScrollBarsVisible.html#C1_Win_FlexGrid_Util_BaseControls_ScrollableControl_ScrollBarsVisible">ScrollBarsVisible</a></div>
    <div><span class="xref">C1.Win.FlexGrid.Util.BaseControls.ScrollableControl.ForceScrollBars</span></div>
</div>
</div>
