2010-12-16 50 views

回答

11

用途:

SystemInformation.HorizontalScrollBarHeight; 
SystemInformation.VerticalScrollBarWidth; 
-1

將此放在您的資源字典:

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

檢查了這一點:

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

+0

問題被標記'WinForms' ... – 2010-12-16 16:12:26

6

出現在您的DataGridView滾動條將是相同的水平高度和垂直寬度爲所有計算機上的其他滾動條。這些尺寸可通過將活性Windows主題定義,並且由.NET Framework暴露在SystemInformation class的以下屬性:

相同類還提供了有關的附加信息當前系統環境中的默認滾動條參數。


如果您需要知道哪些滾動當前可見你的控制,利用其ScrollBars property。這獲取或設置ScrollBars values之一,或者None,Horizontal,VerticalBoth