Here's a copy of my datawindow's "other" event that deals with a scrolling problem that exists when working remotely. Appeon says it has been fixed, but when I last tested it, the amount of lines scrolled up or down, was still not according to your windows mouse settings. Any way long story short.
The code uses the win API "SystemParametersInfoW" function to obtain the amount of lines it should scroll according to windows settings. If you want to use a different amount of lines for up or down scrolling, simply replace "li_WheelMouseLine" with your value instead of assigning it by calling the API function.
(The declaration for the external API function is available in the code as a comment, just before the call).
If you'd want to scroll page by page, you could use the suggestion made by Andrew Barnes: use the Describe function to determine first and lastVisible rows. That way you can find out your page size (assuming you have enough rows on the datawindow to fill a full page). See the PB help for FirstRowOnPage() and LastRowOnPage().
Example: ll_firstRow = long( dw1.Describe("DataWindow.FirstRowOnPage") )
CONSTANT uint WM_MOUSEWHEEL = 522
CHOOSE CASE message.number
CASE WM_MOUSEWHEEL
// v1 and v2, mjl, 13/04/20: Since win8 and w10 totally ignore the mouse settings when working remotely, I've re-introduced the code to scroll:
// First check the user isn't "zooming" by using CTRL+mouseWheel:
IF KeyDown( keyControl!) then
RETURN 0
END IF
// v1 and v2, mjl, 19/05/20: shouldn't scroll when there's only one row:
if this.rowcount() = 1 then
message.processed = true // has to be the last command before doing the RETURN 0
RETURN 0
end if
CONSTANT uint SPI_GETWHEELSCROLLLINES = 104
CONSTANT Long WM_VSCROLL = 277
CONSTANT Long SB_LINEDOWN = 1
CONSTANT Long SB_LINEUP = 0
int li_WheelMouseLine, li_index
int li_lines
// external function declaration:
// Function boolean SystemParametersInfoW(uint wActon, uint wParam, REF int pvParam, uint fUpdateProfile) Library "USER32.DLL"
SystemParametersInfoW(SPI_GETWHEELSCROLLLINES, 0, ref li_WheelMouseLine, 0)
li_lines = IntHigh(wParam) / 120
this.SetRedraw(false)
IF li_lines > 0 THEN
FOR li_index = 1 TO li_WheelMouseLine
Send(Handle(THIS), WM_VSCROLL, SB_LINEUP,0)
NEXT
ELSE
FOR li_index = 1 TO li_WheelMouseLine
Send(Handle(THIS), WM_VSCROLL, SB_LINEDOWN,0)
NEXT
END IF
this.SetRedraw(true) // has to be before setting message.processed = true, if not it makes the message.processed = true to NOT work
message.processed = true // has to be the last command before doing the RETURN 0
RETURN 0
END CHOOSE