Hello Klaus,
I want to decrement the number in lbl1 until the btnm is pressed, the following code doesn't work, after button_up event it goes back in button down even if i set that button is unpressed. could you please tell me how can handle this situation ?
Sub btnm_Down
SetPressed(Btnm,True)
Do While isPressed(Btnm)
If nr=1 Then
nr=49
lbl1.Text =nr
Else
nr=nr-1
lbl1.Text =nr
End If
Loop
End Sub
Sub btnm_Up
SetPressed(Btnm,False)
End Sub
Sub isPressed(btn As Button) As Boolean
Dim r As Reflector
r.Target = btn
Return r.RunMethod("isPressed")
End Sub
Sub SetPressed(Btn As Button, pressed As Boolean)
Dim r As Reflector
r.Target = Btn
r.RunMethod2("setPressed", pressed, "java.lang.boolean")
End Sub