Hello,
Could you give me a small example of what the code should look like when using the mouseposition.X and .Y in with teechart NET 2 and vb.net?
I have a popup menu that is called by right clicking on the chart but if I use the same code I used with the activeX version, it seems to get the wrong coordinates, and the menus/annotations do not show at the same point as the mouse.
Thanks!
J.E.T.
Annotations and popup menus - Mouseposition
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi J.E.T.,
You shouldn't use MousePosition for that. You can try doing the same in a UserControl without a TeeChart and you'll see it hapens the same. You should do something like the code below, it is the same using VB.NET.
You shouldn't use MousePosition for that. You can try doing the same in a UserControl without a TeeChart and you'll see it hapens the same. You should do something like the code below, it is the same using VB.NET.
Code: Select all
private void tChart1_MouseDown(object sender, MouseEventArgs e)
{
X = e.X;
Y = e.Y;
tChart1.Invalidate();
}
private int X, Y;
private void tChart1_AfterDraw(object sender, Steema.TeeChart.Drawing.Graphics3D g)
{
g.TextOut(X, Y, "hello");
}
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 |