How can I get the size of scrollbars in a DataGridView control?

How can I get the height of the horizontal and / or width of the vertical scrollbar that appears on the control (e.g. DataGridView)?

+5
source share
3 answers

Using:

SystemInformation.HorizontalScrollBarHeight;
SystemInformation.VerticalScrollBarWidth;
+11
source

The scrollbars that appear in your DataGridView will have the same horizontal height and vertical width as all other scrollbars on your computer. These sizes are determined by the active theme of Windows and displayed by the .NET Framework in the following SystemInformationclass properties :

.


, , ScrollBars. ScrollBars: None, Horizontal, Vertical Both.

+6

:

<xcdg:DataGridControl >
<xcdg:DataGridControl.Resources>
<Style TargetType="{x:Type xcdg:TableViewScrollViewer}">
<Setter Property="VerticalScrollBarVisibility" Value="Hidden" />
</Style>
</xcdg:DataGridControl>

a >

:

http://msdn.microsoft.com/en-us/library/system.windows.forms.datagridview.scrollbars.aspx

, . , . , , (UI) .

http://msdn.microsoft.com/en-us/library/system.windows.forms.scrollbars.aspx

-1

All Articles