Welcome! Log In Create A New Profile

Advanced

WB 23- Change tab caption to bold by code

Posted by MBeaven 
WB 23- Change tab caption to bold by code
August 30, 2019 09:35PM
Hello all,

I am working on a project in WB 23 where I have a need to make changes to tab panes based on certain variables. More specifically, I am needing to make certain captions bold via code while leaving others as default. I've tried different combinations in both server code and browser code using the syntax TAB_MyTab[2]..Bold = True but am receiving an error that the Bold property is not applicable.

If this is not possible another alternative would be to programmatically change the background color of the pane but I have also been unable to find a way to do this.

Does anyone have experience with changing the pane settings on a tab control by programming that you would not mind sharing?

TIA,

-Marc
Re: WB 23- Change tab caption to bold by code
August 31, 2019 06:14AM
Hello Mark,

May not help but ..fontbold is more what you are looking for. From the help it does include a tab control.


DW
Re: WB 23- Change tab caption to bold by code
August 31, 2019 11:33AM
Maybe
.caption..bold ??
Re: WB 23- Change tab caption to bold by code
August 31, 2019 03:52PM
Appreciate the responses, unfortunately I have tried both of those syntaxes, but with no luck..
Re: WB 23- Change tab caption to bold by code
August 31, 2019 07:37PM
Hello Marc,

I have a Tab Control with 5 Tabs. The ID set by webdev are A7_1 thru A7_5

I created a button turned the browser code to JS and made sure the button runs browser code only:

var btn = document.getElementById("A7_4")
btn.style.fontWeight = 'bold';

//Set it back
var btn = document.getElementById("A7_4")
btn.style.fontWeight = 'initial';

It worked for my test

DW

I no nothing about java script as I am just starting to learn it. So good luck.



Edited 2 time(s). Last edit at 09/01/2019 03:39AM by cabinetman.
Re: WB 23- Change tab caption to bold by code
September 02, 2019 05:43PM
DW-

This did the trick, thanks much for the help! I haven't dabbled much with JS myself but it can really open up possibilities in WB..

Best Regards,

-Marc
Author:

Your Email:


Subject:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.
Message: