예제 #1
0
        /// <summary>
        /// Gets the sroll bar position of the list view.
        /// </summary>
        /// <param name="control">The list view.</param>
        /// <returns>The scroll bar position.</returns>
        /// <exception cref="System.ArgumentNullException">control</exception>
        public static int GetVerticalScrollBarPosition(this Control control)
        {
            control.ThrowIfNull(nameof(control));

            Scrollinfo currentInfo = new Scrollinfo();

            currentInfo.cbSize = Marshal.SizeOf(currentInfo);
            currentInfo.fMask  = (int)ScrollInfoMask.SIF_ALL;

            GetScrollInfo(control.Handle, (int)ScrollBarDirection.SB_VERT, ref currentInfo);
            return(currentInfo.nPos);
        }
예제 #2
0
 public static extern int SetScrollInfo(HandleRef hWnd, int fnBar, Scrollinfo si, bool redraw);
예제 #3
0
 private static extern int GetScrollInfo(IntPtr hwnd, int fnBar, ref Scrollinfo lpsi);
예제 #4
0
 public static extern bool GetScrollInfo(IntPtr hwnd, int fnBar, ref Scrollinfo lpsi);
예제 #5
0
 public static extern int SetScrollInfo(IntPtr hwnd, int fnBar, [In] ref Scrollinfo lpsi, bool fRedraw);
예제 #6
0
 private static extern int GetScrollInfo(IntPtr hwnd, int fnBar, ref Scrollinfo lpsi);
예제 #7
0
        /// <summary>
        /// Gets the sroll bar position of the list view.
        /// </summary>
        /// <param name="control">The list view.</param>
        /// <returns>The scroll bar position.</returns>
        /// <exception cref="System.ArgumentNullException">control</exception>
        public static int GetVerticalScrollBarPosition(this Control control)
        {
            control.ThrowIfNull(nameof(control));

            Scrollinfo currentInfo = new Scrollinfo();
            currentInfo.cbSize = Marshal.SizeOf(currentInfo);
            currentInfo.fMask = (int)ScrollInfoMask.SIF_ALL;

            GetScrollInfo(control.Handle, (int)ScrollBarDirection.SB_VERT, ref currentInfo);
            return currentInfo.nPos;
        }