Ejemplo n.º 1
0
        public void SetScrolPosition(int value)
        {
            WebBrowserAPI.SCROLLINFO lpScrollInfo = new WebBrowserAPI.SCROLLINFO();
            lpScrollInfo.cbSize = (uint)System.Runtime.InteropServices.Marshal.SizeOf(lpScrollInfo);
            lpScrollInfo.fMask  = WebBrowserAPI.SIF_POS;
            lpScrollInfo.nPos   = value;
            WebBrowserAPI.SetScrollInfo(htmlViewHandle, WebBrowserAPI.SB_VERT, ref lpScrollInfo, true);

            Rectangle update = new Rectangle();

            WebBrowserAPI.GetClientRect(htmlViewHandle, ref update);
            WebBrowserAPI.ScrollWindowEx(htmlViewHandle, 0, -(value), 0, 0, IntPtr.Zero, update, WebBrowserAPI.SW_ERASE | WebBrowserAPI.SW_INVALIDATE);
        }
Ejemplo n.º 2
0
        public void SetScrolPosition(int value)
        {
            WebBrowserAPI.SCROLLINFO lpScrollInfo = new WebBrowserAPI.SCROLLINFO();
            lpScrollInfo.cbSize = (uint)System.Runtime.InteropServices.Marshal.SizeOf(lpScrollInfo);
            lpScrollInfo.fMask = WebBrowserAPI.SIF_POS;
            lpScrollInfo.nPos = value;
            WebBrowserAPI.SetScrollInfo(htmlViewHandle, WebBrowserAPI.SB_VERT, ref lpScrollInfo, true);

            Rectangle update = new Rectangle();
            WebBrowserAPI.GetClientRect(htmlViewHandle, ref update);
            WebBrowserAPI.ScrollWindowEx(htmlViewHandle, 0, -(value), 0, 0, IntPtr.Zero, update, WebBrowserAPI.SW_ERASE | WebBrowserAPI.SW_INVALIDATE);
        }