Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
sergio0592
Specialist III
Specialist III

Change font style on click

Hi all,

I often made a change of text box color on clik. But i'am looking for change font style on clik. I want bold font when i clik on text box. How to achieve this?

Regards


4 Replies
stabben23
Partner - Master
Partner - Master

Hi,

try With a macro, use Actio-> run macro->Bold from action on TX01 object

Sub Bold
set obj = ActiveDocument.GetSheetObject("TX01")
font = obj.GetFrameDef.Font
font.Bold = true
obj.SetFont font
end sub

sergio0592
Specialist III
Specialist III
Author

Thanks, but i'am looking for a simpler way, as for color with calculated color.

mbespartochnyy
Creator III
Creator III

I would create a variable and add an action to a box. Then create two identical text boxes, one with bold text and one without. Then add a conditional show condition to hide when the variable contains a specific value.

For example:

  • Create vShow variable
  • Create two text boxes
  • Format one box to have bold text and the other to have a regular text
  • Add Set Variable action to one box to set vShow to 1 and a conditional show expression that would be vShow = 0
  • Add Set Variable action to second box to set vShow to 0 and a conditional show expression that would be vShow = 1

This way when a user clicks on one box it will set variable to 1 and hide that box and reveal the box with bold text. When user clicks on box with bold text, it will set the variable to 0, hide the box with bold text and reveal the box with normal text.

Mikhail B.

sergio0592
Specialist III
Specialist III
Author

Thanks Mikhaïl, it's a good workaround but obliged to duplicate text box objects.