Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. How pass an event to a sub

How pass an event to a sub

Scheduled Pinned Locked Moved Visual Basic
tutorialquestion
5 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • N Offline
    N Offline
    Narenge
    wrote on last edited by
    #1

    Hi guys. I wanna pass an event to a sub but i dono how to perform it. Some thing like this: Private Sub Event_Performer (ByVal arg1 as ????) RaiseEvent arg1 End Sub

    A S D N 4 Replies Last reply
    0
    • N Narenge

      Hi guys. I wanna pass an event to a sub but i dono how to perform it. Some thing like this: Private Sub Event_Performer (ByVal arg1 as ????) RaiseEvent arg1 End Sub

      S Offline
      S Offline
      svanwass
      wrote on last edited by
      #2

      Would this help? http://www.codeproject.com/vb/net/StepByStepEventsInVBNET.asp

      1 Reply Last reply
      0
      • N Narenge

        Hi guys. I wanna pass an event to a sub but i dono how to perform it. Some thing like this: Private Sub Event_Performer (ByVal arg1 as ????) RaiseEvent arg1 End Sub

        A Offline
        A Offline
        AliAmjad
        wrote on last edited by
        #3

        What you really want to accomplish??? why are you doing this !

        AliAmjad(MCP)

        1 Reply Last reply
        0
        • N Narenge

          Hi guys. I wanna pass an event to a sub but i dono how to perform it. Some thing like this: Private Sub Event_Performer (ByVal arg1 as ????) RaiseEvent arg1 End Sub

          D Offline
          D Offline
          Dave Kreskowiak
          wrote on last edited by
          #4

          You're can not pass an event. You can, however, pass an event arguments object, or EventArgs. But, depending on what you're really trying to do with this, normally, the only thing that gets the eventargs is the event handler. The handler then picks out what pieces of information it needs and passes those processed pieces to other methods. You would just about never pass an entire eventargs object to a method that is, itself, not an event handler. It looks like you're trying to raise an event, but the parameters in your header are confusing. What are you really trying to do with this code?? Why does this code exist?

          A guide to posting questions on CodeProject[^]
          Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
               2006, 2007

          1 Reply Last reply
          0
          • N Narenge

            Hi guys. I wanna pass an event to a sub but i dono how to perform it. Some thing like this: Private Sub Event_Performer (ByVal arg1 as ????) RaiseEvent arg1 End Sub

            N Offline
            N Offline
            Narenge
            wrote on last edited by
            #5

            tnx Guys. I'm implementing and error generator sub that take error code and message from various exeption handlings and it should raise respective events.

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups