Shape_Click() events
Posted: 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");
}
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");
}