techknight Well-Known Member Licensed User Longtime User Sep 26, 2018 #1 How do I change the font color of the text field? I tried the text-fill CSS property but its changing the whole thing
How do I change the font color of the text field? I tried the text-fill CSS property but its changing the whole thing
stevel05 Expert Licensed User Longtime User Sep 26, 2018 #2 If you only want to change a few text fields, you can use CSSUtils. If you want to do it in a CSS file then you will need to add a unique class to those textfields you want to alter. Upvote 0
If you only want to change a few text fields, you can use CSSUtils. If you want to do it in a CSS file then you will need to add a unique class to those textfields you want to alter.
techknight Well-Known Member Licensed User Longtime User Sep 26, 2018 #3 Dont think your understanding what I am saying. When I use text-fill with CSSutils, its changing the color of the entire textbox including the font. Code: Copy txtTeamNameHome.Style = "-fx-text-fill: #" & TeamNameHomeColor & ";" Works but changes the whole thing Upvote 0
Dont think your understanding what I am saying. When I use text-fill with CSSutils, its changing the color of the entire textbox including the font. Code: Copy txtTeamNameHome.Style = "-fx-text-fill: #" & TeamNameHomeColor & ";" Works but changes the whole thing
stevel05 Expert Licensed User Longtime User Sep 26, 2018 #4 No I didn't understand the question. You are not using CSSUtils in your code, any other styles already set in txtTeamNameHome.Style will be lost with your code. Having said that, just as a test, this code: Code: Copy TextField1.Style = "-fx-text-fill: Red;" gives me this result: Code: Copy CSSUtils.SetStyleProperty(TextField1,"-fx-text-fill","Red") Gives me the same result. Have you changed anything else for that field either with inline css, the designer or in a style sheet? Last edited: Sep 26, 2018 Upvote 0
No I didn't understand the question. You are not using CSSUtils in your code, any other styles already set in txtTeamNameHome.Style will be lost with your code. Having said that, just as a test, this code: Code: Copy TextField1.Style = "-fx-text-fill: Red;" gives me this result: Code: Copy CSSUtils.SetStyleProperty(TextField1,"-fx-text-fill","Red") Gives me the same result. Have you changed anything else for that field either with inline css, the designer or in a style sheet?
Daestrum Expert Licensed User Longtime User Sep 26, 2018 #5 I am pretty sure you cannot just change individual letter colours in a Textfield. So SomeThingLikeThis can not appear in a Textfield. Upvote 0
I am pretty sure you cannot just change individual letter colours in a Textfield. So SomeThingLikeThis can not appear in a Textfield.
techknight Well-Known Member Licensed User Longtime User Sep 26, 2018 #6 Odd. Ok. I didnt know it overwrote all the existing CSS, that makes sense then. Becuase when I ran it, it would turn the whole box back white. When I had it set black in the Designer. I tried SetStyleProperty and that worked better. Upvote 0
Odd. Ok. I didnt know it overwrote all the existing CSS, that makes sense then. Becuase when I ran it, it would turn the whole box back white. When I had it set black in the Designer. I tried SetStyleProperty and that worked better.