the NPanAndZoomControl does not respond the mouse click event


Author
Message
Suyan Dong
Suyan Dong
Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)
Group: Forum Members
Posts: 17, Visits: 128

Thanks for the reply.That really works. But I want the PanAndZoom.ViewportPreview.Band.Center can be set to the Mouse's position after mouse-click, It seems the NPointF and Point were not the same, So how to move the Band's center to the mouse's position by programming?

Thanks for your time.


Nevron Support
Nevron Support
Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)
Group: Administrators
Posts: 3.1K, Visits: 4.2K

Hi,

The NPanAndZoomControl is built up by several other controls and that is the reason why the Click event does not fire for the pan and zoom control itself - it fired only to the child control that was actually clicked. In your case you should subscribe to the Click even of the pan and zoom control's viewport preview, for example:

nPanAndZoomControl1.ViewportPreview.Click += new EventHandler(ViewportPreview_Click);



Best Regards,
Nevron Support Team


Suyan Dong
Suyan Dong
Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)
Group: Forum Members
Posts: 17, Visits: 128

Why after I set the Click event of the NPanAndZoomControl's Click event, but when I run the program ,After I click on the region of the control, the event does not respond.

How should I deal with this , I would be really glad for your reply.

 

the main code is:

  private Nevron.Diagram.WinForm.NPanAndZoomControl PanAndZoom; 

 this.PanAndZoom.Click += new System.EventHandler(this.PanAndZoom_Click);

   private void PanAndZoom_Click(object sender, EventArgs e)
        {
            NPointF p = PanAndZoom.ViewportPreview.Band.Center;
            p.X += 10;
            p.Y += 10;
            PanAndZoom.ViewportPreview.Band.Center = p;
            PanAndZoom.UpdateMasterView();
        }

 


GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search