{"id":1203,"date":"2012-02-29T02:29:22","date_gmt":"2012-02-29T07:29:22","guid":{"rendered":"http:\/\/anvil-of-time.com\/wordpress\/?p=1203"},"modified":"2021-03-11T11:15:21","modified_gmt":"2021-03-11T16:15:21","slug":"powerbuilder-fontheight-method-in-expressions","status":"publish","type":"post","link":"https:\/\/anvil-of-time.com\/powerbuilder\/powerbuilder-fontheight-method-in-expressions\/","title":{"rendered":"PowerBuilder &#8211; Fontheight method in Expressions"},"content":{"rendered":"<p>An enhancement was put into PB12.1 dealing with determining the height of a datawindow column based on its font setting.  It&#8217;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&#8217;m looking in PB12.5).  You can see a reference to it in the list of methods in the expression painter.<\/p>\n<p>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:<\/p>\n<pre name=\"code\" class=\"VB\">fontheight({colname}[0])\n\/\/ replace {colname} with the specific column name<\/pre>\n<p>To get the value in a script you can use the Evaluate.<\/p>\n<pre name=\"code\" class=\"VB\">string ls_val\nls_val = dw_1.Describe(&quot;Evaluate(&#039;fontheight({colname}&#039;, 1)&quot;)<\/pre>\n<p>This gets the value based on the font of column &#8216;{colname}&#8217; in row 1.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>An enhancement was put into PB12.1 dealing with determining the height of a datawindow column based on its font setting. It&#8217;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&#8217;m looking in PB12.5). You can see a reference to it&hellip;<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[3,10],"tags":[21,12,16],"_links":{"self":[{"href":"https:\/\/anvil-of-time.com\/wp-json\/wp\/v2\/posts\/1203"}],"collection":[{"href":"https:\/\/anvil-of-time.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/anvil-of-time.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/anvil-of-time.com\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/anvil-of-time.com\/wp-json\/wp\/v2\/comments?post=1203"}],"version-history":[{"count":8,"href":"https:\/\/anvil-of-time.com\/wp-json\/wp\/v2\/posts\/1203\/revisions"}],"predecessor-version":[{"id":2022,"href":"https:\/\/anvil-of-time.com\/wp-json\/wp\/v2\/posts\/1203\/revisions\/2022"}],"wp:attachment":[{"href":"https:\/\/anvil-of-time.com\/wp-json\/wp\/v2\/media?parent=1203"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/anvil-of-time.com\/wp-json\/wp\/v2\/categories?post=1203"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/anvil-of-time.com\/wp-json\/wp\/v2\/tags?post=1203"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}