Search code examples
c#eventsscrolldevexpress-windows-uipdftron

Detecting scroll event (pdfnet)


Scenario: The customers have the ability to set an annotation to the PDF page. This is handled as a richtextbox object. There's a bug, however, that when the user is making an annotation and wants to scroll down manually (drag scrollbar down), that the annotation moves with it. I want to implement code that detects the scroll event, so that the annotation can be exited and placed properly before the program scrolls down/up.

What was to be a simple procedure, ended up in a not so simple venture, but I'm getting used to that evolution in programming... We can see the WM_VSCROLL message with spy++, but can't find it with a Console.Writeline in wmdproc, which points to it being handled by an event, but for the life of us, we can't find which event exactly.

We tried overriding our mistery scroll event in both the MainForm as its parent, but no success. Also tried overriding it in the PDFViewCtrl, but it forbids us to override there. So we're kind of at a loss here. We know the event is handled, we just can't find where. We use Pdftron and DevExpress, but it's worth noting that we do not use their DE's PDFViewer. Ours is a PDFViewCtrl loaded into a DevExpress Xtraform.


Solution

  • The annotation scrolling is the expected behaviour. Triggering the lost focus event when clicking on the scroll bars is not possible with the PDFViewCtrl class.