Hello,
I am using Teechart ActiveX v7 in Visual C# . net (yes, I know it would be better to use the .net component, but this is not possible at the moment...).
I have created the TChart component on a form, and it shows up as an 'AxTeechart.AxTChart' object. I would like to pass this object to a class method I have created in another file, but as the class does not have a form, I seem to have only access to the 'TeeChart.TChart' type. (having added a reference to TeeChart and a 'using TChart' directive)
I have tried casting the 'AxTeeChart.AxTChart' object to a 'TeeChart.TChart' but the compiler won't accept this.
Any suggestions on how to allow me to pass the ActiveX as a parameter to my class method?
thanks
passing TChart Activex as parameter in C#
OK nevermind, I've found out how to do this.
For anyone interested:
Visual C# .net creates a wrapper for any activex control dropped into a form. A new dll is created in the debug directory of the project called 'AxInterop.TeeChart.dll'. In the class you must add a reference to this file, AND to the TeeChart Activex. Then add these 2 using directives:
using AxTeeChart;
using TeeChart;
the class can then access the 'AxTeeChart.AxTChart' type.
For anyone interested:
Visual C# .net creates a wrapper for any activex control dropped into a form. A new dll is created in the debug directory of the project called 'AxInterop.TeeChart.dll'. In the class you must add a reference to this file, AND to the TeeChart Activex. Then add these 2 using directives:
using AxTeeChart;
using TeeChart;
the class can then access the 'AxTeeChart.AxTChart' type.