How text size is stored
A control’s text size is specified in the control’s TextSize
property. PowerBuilder saves the text size in points, using negative
numbers.
For example, if you define the text size for the StaticText
control st_prompt to be 12 points, PowerBuilder sets the value of
st_prompt’s TextSize property to–12. PowerBuilder uses negative
numbers to record point size for compatibility with previous releases,
which saved text size in pixels as positive numbers.
If you want to change the point size of text at runtime in a
script, remember to use a negative value. For example, to change the
point size for st_prompt to 14 points, code:
|
1 |
st_prompt.TextSize = -14 |
You can specify text size in pixels if you want, by using
positive numbers. The following statement sets the text size to be 14
pixels:
|
1 |
st_prompt.TextSize = 14 |