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

GetTextMetrics

275 Views

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.

Then:

ratio4Height =

GetTextMetrics(Font12).tmHeight/GetTextMetrics(Font10).tmHeight

ratio4Width =

GetTextExtentPoint32(Font12).cx/GetTextExtentPoint32(Font10).cx

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