Panning with ContextMenuStrip

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
TomAgos
Newbie
Newbie
Posts: 6
Joined: Thu Jan 16, 2025 12:00 am

Panning with ContextMenuStrip

Post by TomAgos » Mon Feb 17, 2025 1:24 pm

Hey

my chart have context menu strip (opens when right clicking)
i can also pan (scroll) in the chart by holding the right key and dragging.
the problem is:
when im panning, the context menu is also opening

how can i solve this? i dont want the context menu to open when panning.


Note: WPF, but using the WinForms version

Marc
Site Admin
Site Admin
Posts: 1288
Joined: Thu Oct 16, 2003 4:00 am
Location: Girona
Contact:

Re: Panning with ContextMenuStrip

Post by Marc » Thu Feb 20, 2025 1:03 pm

Hello,

There are some options to control the panning (scroll), examples here below, including changing the mousebutton used for Panning:

Code: Select all

      //add extra key control to enable panning
      tChart1.Panning.KeyShift = Steema.TeeChart.Drawing.Keys.Shift;

      // swap keys for scroll and zoom and deactivates zoom. (so right key free)
      tChart1.Panning.MouseButton = Steema.TeeChart.Drawing.MouseButtons.Left;
      tChart1.Zoom.MouseButton = Steema.TeeChart.Drawing.MouseButtons.Right;
      tChart1.Zoom.Direction = Steema.TeeChart.ZoomDirections.None;
Regards,
Marc Meumann
Steema Support

Post Reply