B4J Question How can color of menu bar change?

thader2012

Member
Licensed User
Longtime User
Hi all,

Its wonderfull the new version 3.5 of B4J, but i have got any question. How can color of menu bar change? In the previous version I use style css as -fx-text-fill, but now i prove this style in the internal designer but it isnt running.


Any suggestions for this problem, thanks for your help.
 

rwblinn

Well-Known Member
Licensed User
Longtime User
Hi,

have you tried in the Visual Designer to change for the control MenuBar the value of the Color under Drawable ColorDrawable as part of the Background Properties,
Have tested by changing the value to #FFF0F312 and works fine.

upload_2015-7-29_21-38-52.png
 
Upvote 0

thader2012

Member
Licensed User
Longtime User
Thanks, but I talk about the color of text, no background color. With css, using -fx-text-fill, I can change the color of text in the bar menu. Now it isnt runing, How can I do this?
Thanks.
 
Upvote 0

rwblinn

Well-Known Member
Licensed User
Longtime User
OK - Then try:

Create in the Project Files Folder a CSS file (like Main.css) with content (example red text):

B4X:
.menu .label {
  -fx-text-fill: red;
}

In B4J code set the MainForm style - this style applies to all controls:
B4X:
MainForm.Stylesheets.Add(File.GetUri(File.DirAssets, "Main.css"))

#NOTE
The CSS File Main.css can also include other settings.
 
Upvote 0

thader2012

Member
Licensed User
Longtime User
Thanks rwblinn for your answer. Its running ok, I was thinking that i can write -fx-text-fill: red; in EXTRA CSS option of internal designer, but this idea isnt running.

Thank you
 
Upvote 0

rwblinn

Well-Known Member
Licensed User
Longtime User
Hi,

would post a new thread as this is a new question.
As the titlebar is linked to the OS color settings it seems not possible to change. Look here as one of the many answers.
An option is to set the formstyle to undecorated and build your own titlebar.

... but may be one of the experts have a trick at hand ;)
 
Upvote 0

tdocs2

Well-Known Member
Licensed User
Longtime User
Hi,

would post a new thread as this is a new question.
As the titlebar is linked to the OS color settings it seems not possible to change. Look here as one of the many answers.
An option is to set the formstyle to undecorated and build your own titlebar.

... but may be one of the experts have a trick at hand ;)

Thank you, Rob.

I did set the question as a new thread.

I have also experimented with the Win 10 Control Panel Personalization. Like everyone else, I found out that there is no option to just change the color of the title bar.

Best regards.

Sandy
 
Upvote 0
Top