private static class NativeMethods
{
public const int GWL_STYLE = -16;
public const long WS_HSCROLL = 0x00100000;
[DllImport("user32.dll", SetLastError = true, CharSet = CharSet.Auto)]
internal static extern uint GetWindowLong(IntPtr hwnd, int nIndex);
internal static bool HasHorizontalScrollbar(Control control)
{
long i = (GetWindowLong(control.Handle, GWL_STYLE) & WS_HSCROLL);
return i > 0;
}
}