iOS Question B4i slider

tcgoh

Active Member
Licensed User
I am not able the get the slider Valuechange
B4X:
Sub Process_Globals
    Public App As Application
    Public NavControl As NavigationController
    Private Page1 As Page
    Private imageback As ImageView
    Private slider1  As Slider
    Private lbl1 As Label
End Sub

Private Sub Application_Start (Nav As NavigationController)
    NavControl = Nav
    NavControl.ToolBarVisible = True
    Page1.Initialize("Page1")
    Page1.Title = "Page 1"
    NavControl.ShowPage(Page1)
    Page1.RootPanel.LoadLayout("main")
    Page1.RootPanel.Color = Colors.Gray   

End Sub

Private Sub slider1_valuechange (value As Double)
    Dim x As Long
    x = value
    lbl1.Text = x
End Sub
 

klaus

Expert
Licensed User
What exactly is the problem ?

This is wrong
Private Sub slider1_ValueChange (Value As Double)
it must be
Private Sub slider1_ValueChanged (Value As Float)
Two errors, the event type is wrong and the variable type is wrong.
 
Last edited:

tcgoh

Active Member
Licensed User
Thank you very much. I missed the "Slide1_valuechanged" its working very well now.

Value as Double
Dim x As Long
x = value
lbl1.Text = x

works for me as well. Thnaks
 
Top