B4J Question Changing color of textarea scrollbar?

kostefar

Active Member
Licensed User
Longtime User
Dear All,

Is this possible? Here, the scroll-"button" has an almost identical color to the bar.
Also, my mousepointer disappears when in the textarea, which I´d like to know a solution for as well.




Thanks!
 
Last edited:

Erel

B4X founder
Staff member
Licensed User
Longtime User
Customizing TextArea scrollbar:

SS-2018-07-05_09.22.55.png


Create a css file with:
B4X:
.text-area .scroll-bar:vertical {
   -fx-background-color: transparent;
   -fx-border-color:derive(gray,80%);
   -fx-background-radius: 2em;
   -fx-border-radius:2em;
}
.text-area .scroll-bar:vertical .thumb {
    -fx-background-color:derive(black,90%);
   -fx-background-insets: 0, 0, 0;
   -fx-background-radius: 0em;
}

.text-area .increment-button ,.text-area .decrement-button {
    -fx-background-color:white;
   -fx-border-color:derive(black,80%);
}
Load it with:
B4X:
    MainForm.Stylesheets.Add(File.GetUri(File.DirAssets, "style.css"))

Based on: https://blog.ngopal.com.np/2012/07/11/customize-scrollbar-via-css/

Start a new thread for the question about the mouse cursor.
 
Upvote 0

kostefar

Active Member
Licensed User
Longtime User
Customizing TextArea scrollbar:

SS-2018-07-05_09.22.55.png


Create a css file with:
B4X:
.text-area .scroll-bar:vertical {
   -fx-background-color: transparent;
   -fx-border-color:derive(gray,80%);
   -fx-background-radius: 2em;
   -fx-border-radius:2em;
}
.text-area .scroll-bar:vertical .thumb {
    -fx-background-color:derive(black,90%);
   -fx-background-insets: 0, 0, 0;
   -fx-background-radius: 0em;
}

.text-area .increment-button ,.text-area .decrement-button {
    -fx-background-color:white;
   -fx-border-color:derive(black,80%);
}
Load it with:
B4X:
    MainForm.Stylesheets.Add(File.GetUri(File.DirAssets, "style.css"))

Based on: https://blog.ngopal.com.np/2012/07/11/customize-scrollbar-via-css/

Start a new thread for the question about the mouse cursor.

Thanks, works great!
 
Upvote 0
Top