Tayfur Well-Known Member Licensed User Longtime User Feb 12, 2019 #1 How can i get scrollbar's scroll width?
Erel B4X founder Staff member Licensed User Longtime User Feb 13, 2019 #2 There is no simple way to find it. If I remember correctly it is 20 pixels by default. Upvote 0
Cableguy Expert Licensed User Longtime User Feb 13, 2019 #3 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
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)
netsistemas Active Member Licensed User Longtime User Apr 24, 2023 #4 [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
[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
P PaulMeuris Well-Known Member Licensed User Apr 25, 2023 #5 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: Code: Copy MainForm.Stylesheets.Add(File.GetUri(File.DirAssets, "styles.css")) And in the styles.css file you can provide the styling: Code: Copy .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: Happy coding! Last edited: Apr 25, 2023 Upvote 0
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: Code: Copy MainForm.Stylesheets.Add(File.GetUri(File.DirAssets, "styles.css")) And in the styles.css file you can provide the styling: Code: Copy .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: Happy coding!
netsistemas Active Member Licensed User Longtime User Apr 25, 2023 #6 Sorry, I'm looking for b4a, and I landed here without realizing that the message is for B4J Thanks Upvote 0