/// <summary> /// 设置一个值,该值指示控件是否已捕获鼠标。 /// </summary> /// <param name="hWnd">控件句柄。</param> /// <param name="value">如果控件已捕获鼠标,则为 true;否则为 false。</param> public static void SetCapture(IntPtr hWnd, bool value) { if (value) { UnsafeNativeMethods.SetCapture(hWnd); } else { UnsafeNativeMethods.ReleaseCapture(); } }