Page 1 of 1

Problems with redefine keys for Panning

Posted: Fri Jun 30, 2006 1:50 pm
by 9088042
Hello!

I can easily redefine keys for TChart zooming with the help of TChart.Zoom.MouseButton and TChart.Zoom.KeyShift properties. But it is impossible for panning because TChart has only TChart.Panning.MouseButton but hasn't TChart.Panning.KeyShift property.

For example I can't define Alt+Left mouse button to scroll TChart.

Is it possible to add TChart.Panning.KeyShift property?

Thanks in advance,
Alex

Posted: Fri Jun 30, 2006 3:46 pm
by narcis
Hi Alex,

Yes, I'll add it to our wish-list to be implemented for future releases. In the meantime you can do something like this:

Code: Select all

    private void Form1_Load(object sender, EventArgs e)
    {
      bar1.FillSampleValues();
      bar2.FillSampleValues();
      bar3.FillSampleValues();

      tChart1.Panning.Allow = Steema.TeeChart.ScrollModes.None;
      tChart1.Zoom.Allow = false;
    }

    private void tChart1_KeyDown(object sender, KeyEventArgs e)
    {
      if (e.Modifiers == Keys.Alt)
      {
        tChart1.Panning.Allow = Steema.TeeChart.ScrollModes.Both;
      }
    }

    private void tChart1_MouseUp(object sender, MouseEventArgs e)
    {
        tChart1.Panning.Allow = Steema.TeeChart.ScrollModes.None;
    }