Heed help in implementing Mouse Button events in New PDFNet SDK Version

100 views
Skip to first unread message

Jomon Jose

unread,
May 5, 2015, 3:28:22 PM5/5/15
to pdfne...@googlegroups.com
Hello, I have a requirement where I need to implement different Mouse events like Mouse Click, Mouse double Click, Mouse over, Mouse Up, Mouse down etc.,
These functionalities was implement in the project using an old version of PDFNet SDK. But I am unable to implement the same using latest version of PDFNet SDK. Its more like the mouse events of Windows Forms are being implemented rather than the PDFNet's mouse events
Can I have a solution for this.? 

Ryan

unread,
May 7, 2015, 7:00:40 PM5/7/15
to pdfne...@googlegroups.com
You need to subclass the PDFViewCtrl class, add your own overrides.

protected override void OnMouseDown(MouseEventArgs e)
{
// some code
base.OnMouseDown(e); // optionally pass event to PDFViewCtrl
// more code
}


Jomon Jose

unread,
May 15, 2015, 4:45:34 PM5/15/15
to pdfne...@googlegroups.com
Hello Ryan,
I tired doing it. I have a situation here
I have one class say class A derived from another class B. In class A, I am creating an object of MyPDFView class, which inherits the PDFViewCtrl class, in class A. I have all the  mouse events of the PDFViewCtrl coded in class A. This was working fine in PDFNet Version4.0.7.0

But Now i need to update my PDFViewctrl dll to the latest version. So I downloaded Version 6.4.1.29791. The above said mouse events ain't working with this new version.

Below is an extract of the problem
public  class A : class B
{
   MyPDFView _pdfview= new MyPDFView();
  _pdfview.MouseMove += _pdfview_MouseMove;
  _pdfview.MouseDown += _pdfview_MouseDown;
  _pdfview.MouseUp += _pdfview_MouseUp;
  _pdfview.MouseDoubleClick += _pdfview_MouseDoubleClick;


    private void _pdfview_MouseMove(object sender, MouseEventArgs e)
    { 
       MessageBox.Show("hello");
     }
}
and so on for other mouse events.
In old version 4.0.9.0
public class MyPDFView: PDFView
{
}

in new new version
public class MyPDFView: PDFViewCtrl
{

Ryan

unread,
Jul 7, 2015, 3:12:09 PM7/7/15
to pdfne...@googlegroups.com
Please take a look at the PDFViewTest sample, in particular the OnMouseDown override in MyPDFView.cs file. This is working fine.

Reply all
Reply to author
Forward
0 new messages