Results 1 to 2 of 2

Thread: Add handler to Arraylist object [RESOLVED]

  1. #1

    Thread Starter
    Fanatic Member Ruku's Avatar
    Join Date
    Jul 2002
    Location
    Canada
    Posts
    655

    Resolved Add handler to Arraylist object [RESOLVED]

    I need to add an handler to my object...!!!

    here, can't get the .Click to work... without or with the option strict off/on...

    VB Code:
    1. Private o As ArrayList = New ArrayList
    2.  
    3. Form_Load
    4.    o.Add(New RadioButton)
    5. End Sub
    6.  
    7. CmdAdd_Click
    8.    AddHandler o(o.Count - 1).Click, AddressOf oClick
    9. End Sub
    10.  
    11. oClick
    12.    Msgbox "YAY!"
    13. End Sub

    HELP!
    Last edited by Ruku; Nov 7th, 2005 at 09:06 PM.

    Using VB.NET 2005/.NET 2.0, NetBeans IDE 5, Fujitsu Cobol85,
    Website: http://DreamForgery.com

  2. #2

    Thread Starter
    Fanatic Member Ruku's Avatar
    Join Date
    Jul 2002
    Location
    Canada
    Posts
    655

    Re: Add handler to Arraylist object

    Fixed it...

    VB Code:
    1. Private o As ArrayList = New ArrayList
    2.  
    3. Form_Load
    4.    o.Add(New RadioButton)
    5. End Sub
    6.  
    7. CmdAdd_Click
    8.    Dim b as RadioButton
    9.    b = o(o.Count-1)
    10.    AddHandler b.Click, AddressOf oClick
    11. End Sub
    12.  
    13. oClick
    14.    Msgbox "YAY!"
    15. End Sub


    Using VB.NET 2005/.NET 2.0, NetBeans IDE 5, Fujitsu Cobol85,
    Website: http://DreamForgery.com

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