PowerBuilder – Fontheight method in Expressions

Posted on Wednesday, February 29th, 2012 at 2:29 am in

An enhancement was put into PB12.1 dealing with determining the height of a datawindow column based on its font setting. It’s called Fontheight and takes a string parameter. Unfortunately there does not appear to be any documentation on it in the PB help files (I’m looking in PB12.5). You can see a reference to it in the list of methods in the expression painter.

Anyway, to use it to dynamically set the height of a datawindow column based on its font place the following in the height property expression:

fontheight({colname}[0])
// replace {colname} with the specific column name

To get the value in a script you can use the Evaluate.

string ls_val
ls_val = dw_1.Describe("Evaluate('fontheight({colname}', 1)")

This gets the value based on the font of column ‘{colname}’ in row 1.

You might also be interested in

Top