How to cast Steema.TeeChart.Chart class to Steema.TeeChart.TChart class
Posted: Wed Aug 21, 2019 8:03 am
I have several charts (instances of Steema.TeeChart.TChart class) on my form (let's say tChart1, tChart2, etc.).
I have TChart_ClickSeries(object sender, Series s, int valueIndex, MouseEventArgs e) method which I want to use for all charts.
And in this method I need to check for what chart exactly is is being called:
But the sender is Steema.TeeChart.Chart class, not Steema.TeeChart.TChart - so if statement is not working. Steema.TeeChart.Chart class has no Name property - so I cannot check by name.
How to cast Steema.TeeChart.Chart class to Steema.TeeChart.TChart class (or compare it with Steema.TeeChart.TChart)?
I have TChart_ClickSeries(object sender, Series s, int valueIndex, MouseEventArgs e) method which I want to use for all charts.
And in this method I need to check for what chart exactly is is being called:
Code: Select all
if (sender.Equals(tChart1))
{ ... }
else
{ ... }
How to cast Steema.TeeChart.Chart class to Steema.TeeChart.TChart class (or compare it with Steema.TeeChart.TChart)?