Skip to content

Text_Extent - DfBaseWindow

Returns the pixel with of the passed TextValue based on the typeface and style of the current object

Type: Property
Access: Read-Only
Data Type: Integer
Parameters: None

Parameters

Parameter Type Description
sText String Text value

Syntax

Property Integer Text_Extent
Access Type Syntax
Read Access: Get Text_Extent to IntegerVariable

Description

Text_Extent returns the pixel with of the passed sText based on the typeface and style of the current object. This can be used to determine the size of an object based on its text contents. The return value is a folded integer with the hi value representing pixel height and the low value representing width.

This is a folded integer property.

When this property is set, two integer parameters are passed as specified in the parameter list. When the value of the property is retrieved, the value of these two properties is returned as a folded integer. The value of these parameters can be accessed using the hi() and low() functions.

Procedure Autosize String Val
    Integer iExt iHt iWd

    Get Text_Extent Val to iExt
    Move (Hi(iExt)) to iHt
    Move (Low(iExt)) to iWd

    Set GuiSize to (iHt+3) (iWd+2)
    Send Adjust_Logicals
End_Procedure