cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Submit your abstract to the call for content for Discovery Summit Americas by April 23. Selected abstracts will be presented at Discovery Summit, Oct. 21- 24.
Discovery is online this week, April 16 and 18. Join us for these exciting interactive sessions.
Choose Language Hide Translation Bar
DMR
DMR
Level V

Changing the text color of a check box

Hi - I want to change both the text color and the background color of a check box.  The following short example demonstrates that the background color is being changed to red and a border is being added as I'd expect, but the text color is not being changed to yellow as requested.  The properties appear to be correct.  Am I doing something silly here?

cb = check box("Hi There!  ", beep(), << text color("yellow"), << background color("red"), << border(1));

nw = new window("My Window", cb);

show properties(cb);

Many thanks.

1 ACCEPTED SOLUTION

Accepted Solutions
msharp
Super User (Alumni)

Re: Changing the text color of a check box

Seems like Text Color isn't very universal.  It works in some cases (i.e. captions) but not in others.  You could always just create a text box next to the checkbox and color the text there with << Font Color().

tb = text box("Hi There!");

cb = check box("", beep());

nw = new window("My Window", hlistbox(cb,tb));

tb << Font Color("yellow") << background color("red") << border(1);

View solution in original post

3 REPLIES 3
msharp
Super User (Alumni)

Re: Changing the text color of a check box

Seems like Text Color isn't very universal.  It works in some cases (i.e. captions) but not in others.  You could always just create a text box next to the checkbox and color the text there with << Font Color().

tb = text box("Hi There!");

cb = check box("", beep());

nw = new window("My Window", hlistbox(cb,tb));

tb << Font Color("yellow") << background color("red") << border(1);

DMR
DMR
Level V

Re: Changing the text color of a check box

Yes, it looks like that's the best way to do it.  Also I note I that can get the background color to surround the check box by putting the whole thing inside a border box like this:

tb = textbox("Hi there! ", << font color("white"), << set font style("bold"));

bb = borderbox(hlistbox(checkbox("", beep()), tb), << background color("red"), << border(1));

nw = new window("My Window", bb);

Many thanks.

pmroz
Super User

Re: Changing the text color of a check box

I couldn't get that code to work in JMP 11.  This works however:


nw = new window("My Window",

      hlistbox(

            cb = check box(""),

            bb = border box(tb = text box("Hi There!"))

      )

);

tb << Font Color("yellow");

bb << set background color("red") << sides(15);