VB6 WithEvents in C#?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Chua Wen Ching

    #1

    VB6 WithEvents in C#?

    Hi there.

    I search google that i can use delegate and events to
    replace WithEvents.. but i had 1 vb6 sample code.. which i
    not sure how to code it in c#

    Code:
    ====
    private WithEvents ParA as EngineParSystem

    private Sub ParA_NewPar(Vel ocX as Single, VelocY as
    Single, VelocZ as Single)

    LifeS = CurrentLifeT

    End Sub

    So how to code delegates and event with that in c#?

    Any help?

    Thanks.

    Regards,
    Chua Wen Ching
  • Mattias Sjögren

    #2
    Re: VB6 WithEvents in C#?

    [color=blue]
    >Code:
    >====
    >private WithEvents ParA as EngineParSystem
    >
    >private Sub ParA_NewPar(Vel ocX as Single, VelocY as
    >Single, VelocZ as Single)
    >
    >LifeS = CurrentLifeT
    >
    >End Sub
    >
    >So how to code delegates and event with that in c#?[/color]


    private EngineParSystem ParA;

    ....

    ParA.NewPar += new SomeEventHandle rType(ParA_NewP ar);



    Mattias

    --
    Mattias Sjögren [MVP] mattias @ mvps.org

    Please reply only to the newsgroup.

    Comment

    • Mattias Sjögren

      #3
      Re: VB6 WithEvents in C#?

      [color=blue]
      >new SomeEventHandle rType(ParA_NewP ar);
      >
      >--> if not mistaken the SomeEventHandle r is named by me..[/color]

      It should be the delegate type of the NewPar event.

      [color=blue]
      >..(ParA_NewPar )
      >
      >--> i would need to code in c#
      >
      >private void ParA_NewPar(flo at VelocX, float VelocY, float
      >VelocZ)
      >
      >right?[/color]

      Right!



      Mattias

      --
      Mattias Sjögren [MVP] mattias @ mvps.org

      Please reply only to the newsgroup.

      Comment

      Working...