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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. Visual Basic
  4. Handle Keyword?

Handle Keyword?

Scheduled Pinned Locked Moved Visual Basic
questioncsharpasp-netlearning
4 Posts 2 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.
  • R Offline
    R Offline
    Rahithi
    wrote on last edited by
    #1

    hi, i am confused with Handle Keyword. what is this "Handle" key word?? why we need this? i saw this sample code in microsoft core references VB.Net Book. it is referenced to Accessing the user control from the client Page: Proteced WithEvents pbar As PagingBar Private Sub Page_load(ByVal sender As object, ByVal e As EventArgs)_ Handles MyBase.Load pbar=Directcast(findcontrol("PagingBar1").PageingBar) End Sub please can anyone tell me what is "Handle" keyword?? Thanks, Rahi

    If you look at what you do not have in life, you don't have anything, If you look at what you have in life, you have everything... "

    T 1 Reply Last reply
    0
    • R Rahithi

      hi, i am confused with Handle Keyword. what is this "Handle" key word?? why we need this? i saw this sample code in microsoft core references VB.Net Book. it is referenced to Accessing the user control from the client Page: Proteced WithEvents pbar As PagingBar Private Sub Page_load(ByVal sender As object, ByVal e As EventArgs)_ Handles MyBase.Load pbar=Directcast(findcontrol("PagingBar1").PageingBar) End Sub please can anyone tell me what is "Handle" keyword?? Thanks, Rahi

      If you look at what you do not have in life, you don't have anything, If you look at what you have in life, you have everything... "

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

      You can add events after the handles keyword, which allows that procedure to handle a particular event . For instance if I had a procedure that I wanted to handle the click event for a number of buttons I could add each buttons click event after the handles keyword.

      R 1 Reply Last reply
      0
      • T TwoFaced

        You can add events after the handles keyword, which allows that procedure to handle a particular event . For instance if I had a procedure that I wanted to handle the click event for a number of buttons I could add each buttons click event after the handles keyword.

        R Offline
        R Offline
        Rahithi
        wrote on last edited by
        #3

        hi, thanks for answering my question! i have one samll doubt....is it compulsory to use with withevent keyword to handle the event handler?? Thanks, Rahi

        If you look at what you do not have in life, you don't have anything, If you look at what you have in life, you have everything... "

        T 1 Reply Last reply
        0
        • R Rahithi

          hi, thanks for answering my question! i have one samll doubt....is it compulsory to use with withevent keyword to handle the event handler?? Thanks, Rahi

          If you look at what you do not have in life, you don't have anything, If you look at what you have in life, you have everything... "

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

          I'm not sure I understand the question. I don't think 'Withevents' is required in any circumstances. You can use it when you declare a variable. Like 'Withevents txt as new textbox'. This really just makes it easier to add an event handler for your object because you can select the event just like you would for any textbox you put on your form in the designer. However, you can always write an event handler even if you didn't use 'Withevents'. I hope that made some sense to you.

          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