Results 1 to 9 of 9

Thread: Events in C#

  1. #1

    Thread Starter
    yay gay PT Exorcist's Avatar
    Join Date
    Apr 2002
    Location
    . . . my reason of shame
    Posts
    2,729

    Events in C#

    how do i do the VB.NET

    VB Code:
    1. WithEvents mClass as new Class

    in C#?

    and how do i declare events? and raise them?

  2. #2

  3. #3
    Frenzied Member DevGrp's Avatar
    Join Date
    Nov 2001
    Location
    Charlotte, NC
    Posts
    1,256
    Declaring and using events in C# is a little more involved than in VB.NET. Listen to what Kovan said and read up on Delegates.
    Dont gain the world and lose your soul

  4. #4
    PowerPoster hellswraith's Avatar
    Join Date
    Jul 2002
    Location
    Washington St.
    Posts
    2,464
    Here is an example I did that I posted in the Codebank of VBWorld.com
    http://216.26.168.92/vbworld/code.aspx?id=131

  5. #5

    Thread Starter
    yay gay PT Exorcist's Avatar
    Join Date
    Apr 2002
    Location
    . . . my reason of shame
    Posts
    2,729
    ah k tks =)

  6. #6

    Thread Starter
    yay gay PT Exorcist's Avatar
    Join Date
    Apr 2002
    Location
    . . . my reason of shame
    Posts
    2,729
    what is the difference of a delegate and an event? ...

  7. #7

    Thread Starter
    yay gay PT Exorcist's Avatar
    Join Date
    Apr 2002
    Location
    . . . my reason of shame
    Posts
    2,729
    i didnt get with hellswraith's tuturial the real point of a delegate..i just see 50 lines of code just for a simple msg =\

  8. #8
    PowerPoster Lethal's Avatar
    Join Date
    Oct 2000
    Location
    Ohio
    Posts
    2,496
    what is the difference of a delegate and an event? ...
    An event is a type of delegate. You can think of a delegate as a type-safe function pointer. You can use these for dynamtic run-time method invokation and callbacks. Objects use events to notify other objects.
    Last edited by Lethal; Oct 28th, 2002 at 12:28 AM.

  9. #9

    Thread Starter
    yay gay PT Exorcist's Avatar
    Join Date
    Apr 2002
    Location
    . . . my reason of shame
    Posts
    2,729
    hmmmmmmmm

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width