B4J Question ScrollBar Horizzontal ...

ivanomonti

Expert
Licensed User
Longtime User
How can I retrieve the value of a horizontal scrollBar..

B4X:
#Region  Project Attributes
   #MainFormWidth: 600
   #MainFormHeight: 400
#End Region

Sub Process_Globals
   Private fx As JFX
   Private MainForm As Form
   Dim IMscrollbar As ScrollPane
   Dim IMProgressBar As ProgressBar
   Dim IMtextField As TextField
   
End Sub

Sub AppStart (Form1 As Form, Args() As String)
   MainForm = Form1
   MainForm.RootPane.LoadLayout("Layout1") 'Load the layout file.
   MainForm.Show
   
   IMscrollbar.Initialize("IMscrollbar")
   IMtextField.Initialize("IMtextField")
   
End Sub

Sub IMscrollbar_HScrollChanged(Position As Double)
   IMtextField.Text = "Posizione scrollbar: " & Position
End Sub

Sub IMscrollbar_VScrollChanged(Position As Double)
   IMtextField.Text = "Posizione scrollbar: " & Position
End Sub

where I'm wrong, because I do not shoot the event IMscrollbar_HScrollChanged or IMscrollbar_VScrollChanged :)
 

ivanomonti

Expert
Licensed User
Longtime User
ok Erel but does not solve the problem of how to get or set a value to the scrollpane or better if it would be a scrollBar!! :)
 
Upvote 0

ivanomonti

Expert
Licensed User
Longtime User
erel forgive me, but to get the current value of a H scrollBar what should I do, I can not find any reference to it

you can have a quick example

TextField.text = ScrollBar.value
 
Upvote 0
Top