FitTextBoxA

Text, Page layout

Description

The trailing A denotes the ANSI (char) DLL entry point; the ActiveX/COM surface exposes only the Unicode form. Behaviour is identical to FitTextBox and string arguments are interpreted using the current SetAnsiMode code page

Similar to the DrawText function, but the text size is adjusted to ensure that all the text fits into the available space.

Syntax

Delphi

Function DLFitTextBoxA(InstanceID: Integer; Left, Top, Width, Height: Double; Text: PAnsiChar; Options: Integer): Integer;

DLL

int DLFitTextBoxA(int InstanceID, double Left, double Top, double Width, double Height, const char* Text, int Options);

Parameters

LeftThe horizontal co-ordinate of the left edge of the bounding box
TopThe vertical co-ordinate of the top edge of the bounding box
WidthThe width of the bounding box
HeightThe height of the bounding box
TextThe text to display in the box
OptionsVertical alignment: 0 = Centered 1 = Top 2 = Bottom If 100 is added to these values long words will not be split up, the font size will be reduced until the longest word fits into the available width. If 1000 is added to these values the font size will be allowed to increase until the text fills the available area.

Return values

0The Options specified were out of range
1The text was drawn successfully