unassign event

Discussion in 'Questions (Windows Mobile)' started by paul j, Dec 15, 2007.

  1. paul j

    paul j Member Licensed User

    On runtime I add events to an object (e.g. onFocus to a textbox), but on closing the form the event stays active so I get errors when swithing to an other form. I cant find a way to remove te event from the object. Is it possible any way?
     
  2. Erel

    Erel Administrator Staff Member Licensed User

    You can't remove the event.
    You can do something like:
    Code:
    Sub Globals
     handleFocus = 
    true 'you can use an array or an arraylist instead.
    End Sub

    Sub TextBox_GotFocus
     
    If Not(handleFocus) then return
     ...
    End Sub
     
  3. paul j

    paul j Member Licensed User

    That's a possible solution. thanks Erel
     
Loading...