ThRuST Well-Known Member Licensed User Longtime User Feb 18, 2018 #1 Like the headline reads How to change TextArea background color with CSSUtils? The following code only sets the color for the border (I'm using Color picker dialog) And "fx-background" has no effect. CSSUtils.SetBackGroundColor.. is the same as below. Code: CSSUtils.SetStyleProperty(TextArea1,"-fx-background-color", CSSUtils.ColorToHex(Value)) How to do this? Last edited: Feb 18, 2018
Like the headline reads How to change TextArea background color with CSSUtils? The following code only sets the color for the border (I'm using Color picker dialog) And "fx-background" has no effect. CSSUtils.SetBackGroundColor.. is the same as below. Code: CSSUtils.SetStyleProperty(TextArea1,"-fx-background-color", CSSUtils.ColorToHex(Value)) How to do this?
Erel B4X founder Staff member Licensed User Longtime User Feb 18, 2018 #2 I've tried it with this code and it works properly: Code: CSSUtils.SetBackgroundColor(TextArea1, fx.Colors.Red) Upvote 0
I've tried it with this code and it works properly: Code: CSSUtils.SetBackgroundColor(TextArea1, fx.Colors.Red)
ThRuST Well-Known Member Licensed User Longtime User Feb 18, 2018 #3 This is what it looks like. I am using a TextArea in a TabPane. Document tab=HTMLeditor / Code Tab=TextArea) I use a CSS file for the design were I also set textarea properties. Might be that? Code Code: Sub ColorPickerBgr_ValueChanged (Value As Paint) Log (Value) CSSUtils.SetBackgroundColor(TextAreaCode, fx.Colors.Red) End Sub CSS .text-area { -fx-border-width: 0; -fx-border-color: Black; -fx-font-family: Consolas; -fx-font-size: 10; -fx-text-fill: #93c74b; -fx-font-weight: Normal; -fx-display-caret:true; } .text-area .content { -fx-background-color: #1e1e1e; } text-area.scroll-pane { -fx-border-color: Black; } Click to expand... Last edited: Feb 18, 2018 Upvote 0
This is what it looks like. I am using a TextArea in a TabPane. Document tab=HTMLeditor / Code Tab=TextArea) I use a CSS file for the design were I also set textarea properties. Might be that? Code Code: Sub ColorPickerBgr_ValueChanged (Value As Paint) Log (Value) CSSUtils.SetBackgroundColor(TextAreaCode, fx.Colors.Red) End Sub CSS .text-area { -fx-border-width: 0; -fx-border-color: Black; -fx-font-family: Consolas; -fx-font-size: 10; -fx-text-fill: #93c74b; -fx-font-weight: Normal; -fx-display-caret:true; } .text-area .content { -fx-background-color: #1e1e1e; } text-area.scroll-pane { -fx-border-color: Black; } Click to expand...
ThRuST Well-Known Member Licensed User Longtime User Feb 18, 2018 #4 I removed the -fx-background-color in .text-area .context but the problem is still the same. I was hoping CSSUtils would override the CSS settings and in Internal Designer (yes I am only using it since it's better than Scene Builder mostly because of the scaling script which is extremely useful) Upvote 0
I removed the -fx-background-color in .text-area .context but the problem is still the same. I was hoping CSSUtils would override the CSS settings and in Internal Designer (yes I am only using it since it's better than Scene Builder mostly because of the scaling script which is extremely useful)
Erel B4X founder Staff member Licensed User Longtime User Feb 19, 2018 #5 As I said it works when I test it. Start with a new project and try it. Upvote 0
ThRuST Well-Known Member Licensed User Longtime User Feb 19, 2018 #6 Yes I will do that. Also as a way to debug it to build it step by step that should be helpful. Thanks Upvote 0
Yes I will do that. Also as a way to debug it to build it step by step that should be helpful. Thanks