French Problème timer et longclick

lolivier

New Member
Bonjour a tous,
donc mon problème: sur mon applications si on clique une fois on incrémente un label la pas de problème, et je voudrais que lorsque que l'on reste appuyer sur le bouton on incrémente aussi, mais ça ne fonctionne pas, je doit retirer mon doigts et ré-appuyer, je souhaite que si l'on reste sur le bouton on incrémente jusqu’à ce qu'on lâche
Merci d'avance


B4X:
#Region  Activity Attributes
    #FullScreen: False
    #IncludeTitle: True
#End Region

Sub Process_Globals
    'These global variables will be declared once when the application starts.
    'These variables can be accessed from all modules.
Dim val As String = 0
Dim Timer1 As Timer
End Sub

Sub Globals
    'These global variables will be redeclared each time the activity is created.
    'These variables can only be accessed from this module.

    Private button1 As Button
    Private Button2 As Button
    Private Label1 As Label
End Sub

Sub Activity_Create(FirstTime As Boolean)
    'Do not forget to load the layout file created with the visual designer. For example:
    Activity.LoadLayout("Layout1")
Timer1.Initialize("Timer1",100)
End Sub

Sub Activity_Resume

End Sub

Sub Activity_Pause (UserClosed As Boolean)
Timer1.Enabled = False
End Sub

Sub Button2_Click
  
End Sub

Sub Button2_LongClick
  
End Sub

Sub Button1_Click
    val=val+1
    Label1.Text = val
    End Sub

Sub Button1_LongClick
    Timer1.Enabled = True
    val=val+1
    Label1.Text = val
    End Sub

Sub Button1_Up
    Timer1.Enabled = False
End Sub

Sub Timer1_Tick
    Log("tick")
  
  
    End Sub
 
Top