C# property

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Giang Pham

    C# property

    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.Fra meStyle = 2

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


  • Tom Shelton

    #2
    Re: C# property

    On 2005-06-17, Giang Pham <pcgiang@yahoo. com> wrote:[color=blue]
    > 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.Fra meStyle = 2
    >
    > It always has an error like this:
    > " Cannot implicitly convert type 'int' to 'NTGRAPHLib.Fra meStyle "[/color]

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

    m_ctlrGraph.Fra meStyle = (NTGRAPHLib.Fra meStyle) 2;

    --
    Tom Shelton [MVP]

    Comment

    • Joanna Carter \(TeamB\)

      #3
      Re: C# property

      "Giang Pham" <pcgiang@yahoo. com> a écrit dans le message de news:
      O3BkbdvcFHA.242 0@TK2MSFTNGP15. phx.gbl...
      [color=blue]
      > 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.Fra meStyle = 2
      >
      > It always has an error like this:
      > " Cannot implicitly convert type 'int' to 'NTGRAPHLib.Fra meStyle "[/color]

      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.Fra meStyle = NTGRAPHLib.Fram eStyle.<Equival entOfTwo>

      Joanna

      --
      Joanna Carter
      Consultant Software Engineer


      Comment

      Working...