I would like to use the mousewheel to move a vertical cursor across the screen. I set the cursor on the mouse down and am able to detect the mouse wheel. What would be the best approach to achieve this
Thanks
MouseWheel
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi histry,
You can use TeeChart's MouseWheel event like this:
You can use TeeChart's MouseWheel event like this:
Code: Select all
private void Form1_Load(object sender, EventArgs e)
{
line1.FillSampleValues();
cursorTool1.YValue = line1.MinYValue() + ((line1.MaxYValue() - line1.MinYValue()) / 2);
tChart1.MouseWheel += new MouseEventHandler(tChart1_MouseWheel);
}
void tChart1_MouseWheel(object sender, MouseEventArgs e)
{
cursorTool1.YValue += e.Delta/10;
}
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi histry,
Then you can do something like this:
Then you can do something like this:
Code: Select all
private void Form1_Load(object sender, EventArgs e)
{
line1.FillSampleValues();
cursorTool1.YValue = line1.MinYValue() + ((line1.MaxYValue() - line1.MinYValue()) / 2);
cursorTool2.YValue = line1.MinYValue() + ((cursorTool1.YValue - line1.MinYValue()) / 2);
tChart1.MouseWheel += new MouseEventHandler(tChart1_MouseWheel);
}
void tChart1_MouseWheel(object sender, MouseEventArgs e)
{
foreach (Steema.TeeChart.Tools.Tool t in tChart1.Tools)
{
if (t is Steema.TeeChart.Tools.CursorTool)
{
Steema.TeeChart.Tools.CursorTool c = (Steema.TeeChart.Tools.CursorTool)t;
if (c.Clicked(e.X, e.Y) == Steema.TeeChart.Tools.CursorClicked.Horizontal)
{
c.YValue += e.Delta / 10;
}
}
}
}
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |