Map double click event question

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
wilcohsu
Newbie
Newbie
Posts: 40
Joined: Mon Dec 18, 2006 12:00 am

Map double click event question

Post by wilcohsu » Thu Jan 18, 2007 5:30 am

Below code is not work,How fire click and double click event of a map?

private void map1_Click(object sender, System.Windows.Forms.MouseEventArgs e)
{
MessageBox.Show("Shape: "+map1.Labels[ map1.Clicked(e.X, e.Y)]+ " Value: "+map1.ZValues[ map1.Clicked(e.X, e.Y)].ToString());
tChart1.Chart.CancelMouse=true;
}

private void map1_DblClick(object sender, MouseEventArgs e)
{
MessageBox.Show("Shape: "+map1.Labels[ map1.Clicked(e.X, e.Y)]+ " Value: "+map1.ZValues[ map1.Clicked(e.X, e.Y)].ToString());
tChart1.Chart.CancelMouse=true;
}



Best Regards!!

Edu
Advanced
Posts: 206
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia

Post by Edu » Thu Jan 18, 2007 9:47 am

Hi wilcohsu

You can't do a map1_Click and map1_DblClick simultaneously because map1_Click will always be executed before map1_DblClick. Also, series' double click event doesn't work, this is a problem we recently found and is on of the most prioritary bug to fix for the next release.

In the meantime, as a workaround you can implement double click event for series doing something like this:

Code: Select all

private void tChart1_DoubleClick(object sender, EventArgs e)
        {
            if (map1.Clicked(X, Y) != -1)
            {
                MessageBox.Show("Shape: " + map1.Labels[map1.Clicked(X, Y)] + " Value: " + map1.ZValues[map1.Clicked(X, Y)].ToString());
                tChart1.Chart.CancelMouse = true;
            }       
        }

        private int X,Y;

        private void tChart1_MouseDown(object sender, MouseEventArgs e)
        {
            X = e.X;
            Y = e.Y;
        }
Best Regards,
Edu

Steema Support Central
http://support.steema.com/

Post Reply