Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
460
Scrolling speed up?
posted

I have recieved the following email from one of our users, and was wondering whether anyone thought this were a feasible suggestion to fit into an UltraGrid, and if so how would you go about fitting this into the scrolling / painting mechanism used by the UltraGrid?

"i was just wondering if you could get a rendering speed up on the main bug listview by using a P/Invoke call to the Win32 ScrollWindowEx() function to scroll the screen then only render the small amount that's necessary?

something like this should do the trick:

    [DllImport("user32.dll")]
    public static extern int ScrollWindowEx(IntPtr hWnd, int dx, int dy, IntPtr scrollRect, IntPtr clipRect, IntPtr hrgn, ref Rect updateRect, uint flags);

then you can call ScrollWindowEx() with the listview 'Handle' to scroll the window up and draw the small amount at the bottom that needs rendering.
"

Thanks

Chris

 

Parents
No Data
Reply
  • 460
    posted

    Sorry - I may have posted slightly prematurely.  From digging through the source I see that UltraControlBase contains a method ScrollControl(...) which is a wrapper around the native ShowWindowEx(...).

    This has the summary below:

             /// <summary>
            /// Will call ther native windows ScvrollWindowEx api if the caller
            /// has securoty permissions to call unmanaged code. If not this
            /// method will just invalidate the control.  
            /// </summary>

    Internally the grid also seems to call the static method DrawUtility.ScrollControl which seems to do the same thing. 

    So I guess my question is: Is it safe to assume that the UltraGrid is already using ShowWindowEx where possible?  ie If the user has permissions to call / execute unmanaged code.

    Thanks,

Children