Seekbar Userchange Questions

tcgoh

Active Member
Licensed User
Longtime User
Hi,

I have search the forum, but could not get a simple code for the above. Could someone help?

I am trying the get the value of the seekbar to be displayed in a label box when the userchange the seekbar position.

B4X:
Sub seekbar1_Valuechange ( Value As Int, userchange As Boolean)
   If userchange Then
      label.Text = Value
   End If

End Sub


?? thanks
 

tcgoh

Active Member
Licensed User
Longtime User
What's the problem, your code is right.
You just need to make sure that the Label you are refering to, is in a layout or defined in the code.

Best regards.

Hi Klaus,


Thanks Klaus for the quick reply.
But I'm NOT getting any "value" in my label box, here is my code
B4X:
Sub Globals
   Dim lblto As Label
   Dim seekbar1 As SeekBar
End Sub

Sub Activity_Create(FirstTime As Boolean)
   lblto.Initialize("lblto")
   Activity.LoadLayout("Main")
   lblto.SetLayout(5%x,75%y,15%x,7%y)
      
   seekbar1.Max = 100
   
End Sub

Sub seekbar1_Valuechange ( Value As Int, userchange As Boolean)
   If userchange Then
      lblto.Text = Value
   End If
End Sub

What am I missing?:BangHead:
 
Upvote 0

tcgoh

Active Member
Licensed User
Longtime User


It is still NOT working??

Regards
 
Upvote 0

tcgoh

Active Member
Licensed User
Longtime User

OK that did it. Great thanks.

:sign0098:
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…