Han*_*ant 18
是的,这是一个系统设置.使用SystemInformation.HorizontalScrollBarHeight和SystemInformation.VerticalScrollBarWidth.
命名空间:System.Windows.Forms
在.Net CF上,在哪里SystemInformation.HorizontalScrollBarHeight和SystemInformation.VerticalScrollBarWidth不存在,需要一些P/Invoke:
public sealed class Native
{
public static Int32 GetVerticalScrollbarWidth()
{
return GetSystemMetrics(SM_CXVSCROLL);
}
public Int32 GetHorizontalScrollbarHeight()
{
return GetSystemMetrics(SM_CYHSCROLL);
}
[DllImport("coredll.dll", SetLastError = true)]
public static extern Int32 GetSystemMetrics(Int32 index);
public const Int32
SM_CXVSCROLL = 2,
SM_CYHSCROLL = 3;
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
10227 次 |
| 最近记录: |