M micro Well-Known Member Licensed User Longtime User Feb 1, 2014 #1 Hi I have a small problem with text color: Code: Copy mb.Style = "-fx-font-size: 18;" & "-fx-font-weight: normal;" & "-fx-text-fill: #000000;" & "-fx-background-color:linear-gradient(To top, white, #3c7fb1);" mb is a MenuBar, only a text color of menubar not work, it is always white. Why?
Hi I have a small problem with text color: Code: Copy mb.Style = "-fx-font-size: 18;" & "-fx-font-weight: normal;" & "-fx-text-fill: #000000;" & "-fx-background-color:linear-gradient(To top, white, #3c7fb1);" mb is a MenuBar, only a text color of menubar not work, it is always white. Why?
Erel B4X founder Staff member Licensed User Longtime User Feb 2, 2014 #2 You should create a css file and put it in the Files folder: Code: Copy .menu .label { -fx-text-fill: red; } .menu-item .label { -fx-text-fill: red; } In your code: Code: Copy Sub AppStart (Form1 As Form, Args() As String) MainForm = Form1 MainForm.RootPane.LoadLayout("1") 'Load the layout file. MainForm.Show MainForm.Stylesheets.Add(File.GetUri(File.DirAssets, "tb.css")) 'tb.css is the css file. End Sub Upvote 0
You should create a css file and put it in the Files folder: Code: Copy .menu .label { -fx-text-fill: red; } .menu-item .label { -fx-text-fill: red; } In your code: Code: Copy Sub AppStart (Form1 As Form, Args() As String) MainForm = Form1 MainForm.RootPane.LoadLayout("1") 'Load the layout file. MainForm.Show MainForm.Stylesheets.Add(File.GetUri(File.DirAssets, "tb.css")) 'tb.css is the css file. End Sub
M micro Well-Known Member Licensed User Longtime User Feb 2, 2014 #4 Another question... how do I change the label width for item menu? or even better, label autosize for the content? Thanks Upvote 0
Another question... how do I change the label width for item menu? or even better, label autosize for the content? Thanks
Erel B4X founder Staff member Licensed User Longtime User Feb 2, 2014 #5 The menu items should expand their size automatically. Can you post a screenshot? Upvote 0
M micro Well-Known Member Licensed User Longtime User Feb 2, 2014 #6 in fact on a PC autosize works fine but on a PC with a 24 inch monitor the text is truncated Upvote 0
Erel B4X founder Staff member Licensed User Longtime User Feb 3, 2014 #7 Can you post a screenshot? Upvote 0