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

已查看 100 次
跳至第一个未读帖子

Jomon Jose

未读,
2015年5月5日 15:28:222015/5/5
收件人 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

未读,
2015年5月7日 19:00:402015/5/7
收件人 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

未读,
2015年5月15日 16:45:342015/5/15
收件人 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

未读,
2015年7月7日 15:12:092015/7/7
收件人 pdfne...@googlegroups.com
Please take a look at the PDFViewTest sample, in particular the OnMouseDown override in MyPDFView.cs file. This is working fine.

回复全部
回复作者
转发
0 个新帖子