B4J Question scroll width

Cableguy

Expert
Licensed User
Longtime User
The best way is to use an inverted set/get.

You created the setter/getter using CSS and a global variable to hold the current value.
For this to work, you need to first set it to a known value.

(I'm assuming you will want to do more than just know the scrollbar width)
 
Upvote 0

netsistemas

Active Member
Licensed User
Longtime User
[CÓDIGO=b4x]
Dim jo = CustomLw.sv como JavaObject

jo.RunMethod("setScrollBarSize", Matriz como objeto (100))
[/CÓDIGO]

este código establece el ancho, pero el botón para desplazar la vista no tiene efecto
 
Upvote 0

PaulMeuris

Active Member
Licensed User
This thread has come back alive like so many others! Why not create a new thread and refer to the old one?
I forgot to look at the date of the first message...
Anyway, here's some useful information about the subject...

If you want to change the size of a scrollbar from a scrollpane (B4J) then here's what you can do:
Include a stylesheet in the Main module:
Main module:
    MainForm.Stylesheets.Add(File.GetUri(File.DirAssets, "styles.css"))
And in the styles.css file you can provide the styling:
CSS:
.scroll-pane .scroll-bar:horizontal {
    -fx-background-color: #A199F7;
    -fx-font-size: 30;
}
.scroll-pane .scroll-bar:hover {
    -fx-background-color: #94FFFA;
}
And here's how it looks like:
1682391381010.png

Happy coding!
 
Last edited:
Upvote 0

netsistemas

Active Member
Licensed User
Longtime User
Sorry, I'm looking for b4a, and I landed here without realizing that the message is for B4J
Thanks
 
Upvote 0
Top