Shape_Click() events

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
HQO
Newbie
Newbie
Posts: 25
Joined: Thu Jun 05, 2003 4:00 am
Contact:

Shape_Click() events

Post by HQO » Tue Dec 02, 2003 2:21 pm

I have a problem to get Click-event to work when creating shape series dynamically. When I'm using editor to create new one, then shape_Click - event works.

Here's the sample code, any ideas?


public class Form2 : System.Windows.Forms.Form
{

private Steema.TeeChart.Styles.Shape shape;
.
.
.


// create new shape
private void button2_Click(object sender, System.EventArgs e)
{

shape = new Steema.TeeChart.Styles.Shape();
tChart1.Series.Add(shape);

shape.X0 = 4;
shape.X1 = 9;
shape.Y0 = 5;
shape.Y1 = 12;
shape.Style = Steema.TeeChart.Styles.ShapeStyles.Rectangle;
shape.Transparent=false;
shape.Pen.Color=Color.Blue;
shape.Pen.Width=2;
shape.Brush.Color=Color.Blue;
shape.Font.Size=1;
shape.Click += new System.Windows.Forms.MouseEventHandler(this.shape_Click);
}

public void shape_Click(object sender, System.Windows.Forms.MouseEventArgs e)
{
MessageBox.Show("Shape clicked");
}

Pep
Site Admin
Site Admin
Posts: 3295
Joined: Fri Nov 14, 2003 5:00 am
Contact:

Post by Pep » Tue Dec 02, 2003 2:49 pm

Yes, this is a known bug (already added on our defect list), it sonly happens using the Rectanlgle style. We'll try to fix if for the next maintenance releases.

Josep Lluis Jorge
http://support.steema.com

Simon
Newbie
Newbie
Posts: 14
Joined: Wed Nov 26, 2003 5:00 am
Location: Québec

Post by Simon » Thu Dec 18, 2003 6:44 pm

Hello,

Does it mean that every runtime interactive events that respond to user mouseclicks will not work in TeeChart Pro.NET ?

My WebChart is PostBack.
I tried to make events with mouse, like ClickBackground, ClickSeries, ClickTitle. The mouse cursor is a hand (means there is a link).
My WebChart is printed and filled with data in it but when I click, I just get a postback (refresh browser) with same data. My events are simple :

private void WebChart1_ClickTitle(object sender, System.Web.UI.ImageClickEventArgs e)
{
txtMessage.Text = "Test!";
}

I know that the program doesn't enter in this function (I set breakpoint).

Is it normal that events don't work or there is something I missed ?


Thank you,
Simon

Christopher
Site Admin
Site Admin
Posts: 1349
Joined: Thu Jan 01, 1970 12:00 am
Location: Riudellots de la Selva, Catalonia
Contact:

Post by Christopher » Tue Jan 13, 2004 4:00 pm

Hi Simon,

Have you tried running the ASP.NET example under:
C:\Program Files\Steema Software\TeeChart for .NET v1\TeeChartForNET\WebForm ?

Try creating a C# ASP.NET project on your machine and copying all the *.aspx.* files across to it.

Now change part of the Page_Load() method so it looks like this:

Code: Select all

//setup Chart
if (ch1.Series.Count<2)
{ 
  ch1.Series.Add(new Steema.TeeChart.Styles.Points());
  ch1.Series.Add(new Steema.TeeChart.Styles.Shape());
}
ch1.Header.Text="Chart 1. Click on Points of this Chart to see event demo.";
		
ch1.Series[0].FillSampleValues(5);
ch1.Series[1].FillSampleValues(1);
Now cut the following line from the InitializeComponent() method:

Code: Select all

this.WebChart1.ClickSeries += new Steema.TeeChart.Web.WebChart.SeriesEventHandler(this.WebChart1_ClickSeries);
And paste it into the beginning of the Page_Load function ... this seems to work OK here. Does it work OK at your end?
Thank you!

Christopher Ireland (Steema crew)
Please be aware of the newsgroup archives:
http://www.teechart.net/support/search.php
http://groups.google.com
http://codenewsfast.com/

Simon
Newbie
Newbie
Posts: 14
Joined: Wed Nov 26, 2003 5:00 am
Location: Québec

Post by Simon » Mon Jan 19, 2004 3:58 pm

Ok, it didnt work in the previous version, but now, with the patch, it works! Thank for your help.
Simon Rinfret

Post Reply