2010-07-08 15 views

Respuesta

14

Sí, es una configuración del sistema. Use SystemInformation.HorizontalScrollBarHeight y SystemInformation.VerticalScrollBarWidth.

+0

pensé que existía, gracias! – SwDevMan81

6

En .Net CF, donde SystemInformation.HorizontalScrollBarHeight y SystemInformation.VerticalScrollBarWidth no existen,/Invoke se requiere algún P:

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

Gracias, me salvó un montón de molestias – Manatherin

Cuestiones relacionadas