Skip to Content
Former Member
Apr 25, 2008 at 12:24 PM



Hi everyone...

we want to create new forms in SAP via the SDK. We can add items my oForm.Items.Add() and then set the height of the item (specially for EditText and StaticText).

We want to get the correct height for the items according to the fontsize selected in SAP Business One.

The Support wrote this:

The following is how Business One calculates the Form size in relation

to the font size:

Business One uses 2 windows APIs(GetTextMetrics and

GetTextExtentPoint32) to achieve font size change:

For example:

oldFont = 10, newFont = 12.


ratio4Height =


ratio4Width =


But we don't get a value using the GetTextMetrics-API in Microsoft Visual Studio 2005.

Does anyone has an idea how we can use the API correctly?

Best regards,

Manuel Marhold

SoftChip EDV-Systeme