Annotations and popup menus - Mouseposition

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
thomaz
Newbie
Newbie
Posts: 2
Joined: Fri Apr 28, 2006 12:00 am

Annotations and popup menus - Mouseposition

Post by thomaz » Mon Jun 05, 2006 1:00 pm

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.

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Tue Jun 06, 2006 4:12 pm

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.

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
Image Image Image Image Image Image
Instructions - How to post in this forum

Post Reply