Skip to main content
Pie
ra0

TcxCanvas.TextWidth(string) Method

Returns the width of a specified string, in pixels.

Declaration

function TextWidth(const Text: string): Integer;

Parameters

Name Type
Text string

Returns

Type
Integer

Remarks

Call the TextHeight and TextWidth functions and pass a string as the Text parameter to identify the string’s dimensions at the current Font settings. This is useful if you need to calculate other UI element sizes and positions to accommodate text properly.

See Also