参看:
Windows消息定义网址:http://wenku.baidu.com/link?url=9fesYjbLSDx9_TsLgSZSVoR7ELal-60x2p-lua_iPR44Xfekz0N5p2MxoAbJHzrXWH_FgDeyKSczHDHfa-QDKPGsQy3BnE2wootlnPeXFtu
还有 http://bbs.csdn.net/topics/80015678
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; } }
若有更好方法,欢迎留言推荐。
时间: 2024-11-11 00:44:06