2010-07-08 38 views

Trả lời

14

Có, đó là cài đặt hệ thống. Sử dụng SystemInformation.HorizontalScrollBarHeight và SystemInformation.VerticalScrollBarWidth.

+0

I figured nó tồn tại, cảm ơn! – SwDevMan81

6

On Net CF, nơi SystemInformation.HorizontalScrollBarHeightSystemInformation.VerticalScrollBarWidth không tồn tại, một số P/Gọi là cần thiết:

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; 
} 
+0

Xin cảm ơn, đã cứu tôi rất nhiều rắc rối – Manatherin

Các vấn đề liên quan