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. AddHandler Question

AddHandler Question

Scheduled Pinned Locked Moved Visual Basic
questioncsharpdatabasevisual-studiohelp
3 Posts 3 Posters 1 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.
  • P Offline
    P Offline
    Pete Newman
    wrote on last edited by
    #1

    vs.net ( vb ) 2005 I have a form which when loaded adds x number of checkboxes. In the function i have written to add the checkboxes i have included the folling lines ACheckBox.Tag = Index ' Index being the number of the current Checkbox AddHandler aCheckBox.CheckChanged, AddressOf MyClickHandler How in the 'MyClickHandler' sub will i be able to find the index of the aCheckBox that was clicked ? Thanks for any help :doh:

    I really do need help..... all this computer stuff is way over my head !!

    N D 2 Replies Last reply
    0
    • P Pete Newman

      vs.net ( vb ) 2005 I have a form which when loaded adds x number of checkboxes. In the function i have written to add the checkboxes i have included the folling lines ACheckBox.Tag = Index ' Index being the number of the current Checkbox AddHandler aCheckBox.CheckChanged, AddressOf MyClickHandler How in the 'MyClickHandler' sub will i be able to find the index of the aCheckBox that was clicked ? Thanks for any help :doh:

      I really do need help..... all this computer stuff is way over my head !!

      N Offline
      N Offline
      nlarson11
      wrote on last edited by
      #2

      Sub MyClickHandler(sender as object,e as system.eventargs) sender.tag ' checkbox that was checked. end sub

      1 Reply Last reply
      0
      • P Pete Newman

        vs.net ( vb ) 2005 I have a form which when loaded adds x number of checkboxes. In the function i have written to add the checkboxes i have included the folling lines ACheckBox.Tag = Index ' Index being the number of the current Checkbox AddHandler aCheckBox.CheckChanged, AddressOf MyClickHandler How in the 'MyClickHandler' sub will i be able to find the index of the aCheckBox that was clicked ? Thanks for any help :doh:

        I really do need help..... all this computer stuff is way over my head !!

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

        To expand on the other posters answer... When you create the checkboxs in your code, set the Tag property of each CheckBox to the number you want. You can then look at that property in the ClickHandler code to figure out which one was clicked.

        Dave Kreskowiak Microsoft MVP - Visual Basic

        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