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. Event and Functions

Event and Functions

Scheduled Pinned Locked Moved Visual Basic
4 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.
  • S Offline
    S Offline
    Sonia Gupta
    wrote on last edited by
    #1

    Is it write to say that an event is private sub Form_Load(byval sender as system.Object,byval e as System.Eventargs)handes MyBase.Load End sub and functions is private function abc()as string end function

    C G T 3 Replies Last reply
    0
    • S Sonia Gupta

      Is it write to say that an event is private sub Form_Load(byval sender as system.Object,byval e as System.Eventargs)handes MyBase.Load End sub and functions is private function abc()as string end function

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      Nilish wrote:

      handes MyBase.Load

      This bit means that this function will be called in response to an event.

      Christian Graus - Microsoft MVP - C++ Metal Musings - Rex and my new metal blog "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )

      1 Reply Last reply
      0
      • S Sonia Gupta

        Is it write to say that an event is private sub Form_Load(byval sender as system.Object,byval e as System.Eventargs)handes MyBase.Load End sub and functions is private function abc()as string end function

        G Offline
        G Offline
        GgAben
        wrote on last edited by
        #3

        private sub Form_Load(byval sender as system.Object,byval e as System.Eventargs)handes MyBase.Load End sub

        This Form_Load is a event handler for Load event. That means when the page load event fires this handler will be invoked. Then, then function

        private function abc()as string end function

        This is need to call as abc() for executing.

        Gg

        1 Reply Last reply
        0
        • S Sonia Gupta

          Is it write to say that an event is private sub Form_Load(byval sender as system.Object,byval e as System.Eventargs)handes MyBase.Load End sub and functions is private function abc()as string end function

          T Offline
          T Offline
          TwoFaced
          wrote on last edited by
          #4

          Private sub Form_Load... isn't an event. It's a procedure that handles an event. Any procedure can handle an event as long as it matches the signature of the event. A function returns a value while a procedure does not. This is how you could define an event.

          Public Event SomeEvent(ByVal sender As Object, ByVal e As System.EventArgs)

          The signature would be the parameters in the definition. I could also create an event like this.

          Public Event AnotherEvent(ByVal someText As String)
          

          In this case the procedure to handle this event would need to accept a string. Any procedure that does so can handle this event. It's good practice to create events that with the .net signature of (sender, e) where sender is an object and 'e' inherits from system.eventargs.

          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