C# property

  • Thread starter Thread starter Giang Pham
  • Start date Start date
G

Giang Pham

I create one activeX by using C++ dot Net. Then I using it on a from of C#
project, I insert and have it a name (m_ctrlGraph)
When I use its property, such as:

m_ctrlGraph.FrameStyle = 2

It always has an error like this:
" Cannot implicitly convert type 'int' to 'NTGRAPHLib.FrameStyle "
 
I create one activeX by using C++ dot Net. Then I using it on a from of C#
project, I insert and have it a name (m_ctrlGraph)
When I use its property, such as:

m_ctrlGraph.FrameStyle = 2

It always has an error like this:
" Cannot implicitly convert type 'int' to 'NTGRAPHLib.FrameStyle "

My guess is that your .FrameStyle property takes a enumerated
constant... Try:

m_ctlrGraph.FrameStyle = (NTGRAPHLib.FrameStyle) 2;
 
I create one activeX by using C++ dot Net. Then I using it on a from of C#
project, I insert and have it a name (m_ctrlGraph)
When I use its property, such as:

m_ctrlGraph.FrameStyle = 2

It always has an error like this:
" Cannot implicitly convert type 'int' to 'NTGRAPHLib.FrameStyle "

Then you should find out the name of the enumeration member that equates to
2 and use that instead.

I don't know the component set you are using but you should see something
like this :

m_ctrlGraph.FrameStyle = NTGRAPHLib.FrameStyle.<EquivalentOfTwo>

Joanna
 
Back
Top