AddEvent but no RemoveEvent??

Discussion in 'Questions (Windows Mobile)' started by LineCutter, Apr 19, 2008.

  1. LineCutter

    LineCutter Active Member Licensed User

    I'm probably missing something, but when I add a panel & some buttons, dispose of them all & then call the routines again I get the button_click sub called twice. Debugging shows that there is no detour between endsub & the first statement of the same sub.
    Bug in B4PPC or in my programming??

    Called from an imagebutton:
    (Prefstable has 4 locations, one hardcoded as "All")
    Sub OtherButton_ButtonDown
    "Main""OtherPanel"1010 ,225255)
    For i = 0 To prefstable.rowcount-1
    "OtherPanel", Prefstable.cell("Location",i)&"Button",spacer,((i+1)*spacer)+(i*buttonheight),ButtonWidth, ButtonHeight,Prefstable.cell("Location",i))
    'AddEvent (Control Name, Event Name, Sub Name)
            AddEvent (Prefstable.cell("Location",i)&"Button", Click, "SetFilter")
    End Sub
    Calls this:
    Sub SetFilter
    If Sender.text="All" Then
    End If
    For i = 0 To prefstable.rowcount-1
    End Sub
    Which repeats twice on the second call (button click) & errors because the sender doesn't exist for the second loop through the sub. Curiously, there are only 2 loops if I opt to continue after the error.
  2. agraham

    agraham Expert Licensed User

  3. LineCutter

    LineCutter Active Member Licensed User

    Thanks - I didn't mange to find that thread myself, but it makes it all clear now.
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice