Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
            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);
            }