Jump to content


Photo

How to intercept scrollbar event and handle it oneself

scrollbar event

  • Please log in to reply
2 replies to this topic

#1 Alfred

Alfred
  • Members
  • 17 posts
  • Gender:Male
  • Location:UK

Posted 21 April 2017 - 07:52 AM

I believe "procedure WMVScroll(var Message: TWMVScroll); message WM_VSCROLL;" handles the vertical scrolls.

 

I am dealing with a massive number of rows (>10^6). I tried it but NextGrid was very slow - which is understandable.

 

I want to be able to scroll a small subset (100 rows) of the data and handle the refreshes when the user scrolls beyond this subset. In order to do this, I need to be able to intercept the vertical scrollbar events and to position correctly the thumb on scrollbar.

 

I would much appreciate a tiny example of how to do it.



#2 Boki (Berg)

Boki (Berg)

    Boki (Berg)

  • Forum Admin
  • PipPipPipPipPip
  • 7,450 posts
  • Gender:Male

Posted 21 April 2017 - 09:18 PM

Hi,

Maybe using NextDBGrid v5 and then using NxVirtualDataSet is best solution for your case.

That way only records visible on screen will be used. Also, similar can be done with NextVirtualGrid6.

If you want to do something by yourself, I recommend taking a look at my class NxScrollControl or one in v6 too. I must warn that unfortunately this area (WinApi scrollbars) can be tricky :( I'm still not 100% master for them even after 10 yrs :)
boki@bergsoft.net | LinkedIn Profile
--
BergSoft Home Page: www.bergsoft.net
Members Section: bms.bergsoft.net
Articles and Tutorials: dn.bergsoft.net (Developers Network)
--
BergSoft Facebook page
--
Send us applications made with our components and we will submit them on: www.bergsoft.net/apps.htm. Link to this page will be also set on home page too.

#3 Alfred

Alfred
  • Members
  • 17 posts
  • Gender:Male
  • Location:UK

Posted 22 April 2017 - 12:32 PM

Thanks. I will put on my thinking cap.  :mellow:






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users