private int ScrollThumbPosition(int fnBar) { var si = new NativeMethods.SCROLLINFO { fMask = NativeMethods.SIF_TRACKPOS }; NativeMethods.GetScrollInfo(new HandleRef(this, Handle), fnBar, si); return(si.nTrackPos); }
public void UpdateScrollInfo() { if (!_parentControl.IsHandleCreated || !Visible) { return; } var si = new NativeMethods.SCROLLINFO { cbSize = Marshal.SizeOf(typeof(NativeMethods.SCROLLINFO)), fMask = NativeMethods.SIF_ALL, nMin = 0, nMax = Maximum, nPage = LargeChange, nPos = Value, nTrackPos = 0 }; NativeMethods.SetScrollInfo(new HandleRef(_parentControl, _parentControl.Handle), _orientation, si, true); }