PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadApple WatchUniversal Windows 10 AppWindows Mobile
Others
Stored procedures
TextWidth (Function)
In French: TexteLargeur
Calculates the width (in pixels) of the text displayed in an edit control, in a Combo Box control or in a Static control. This allows you to predict the width occupied by the text in order to enlarge the control if necessary.
Versions 15 and later
Android This function is now available for the Android applications.
New in version 15
Android This function is now available for the Android applications.
Android This function is now available for the Android applications.
Versions 16 and later
WINDEVLinux This function is now available for the WINDEV applications in Linux.
New in version 16
WINDEVLinux This function is now available for the WINDEV applications in Linux.
WINDEVLinux This function is now available for the WINDEV applications in Linux.
Versions 18 and later
iPhone/iPad This function is now available for the iPhone/iPad applications.
New in version 18
iPhone/iPad This function is now available for the iPhone/iPad applications.
iPhone/iPad This function is now available for the iPhone/iPad applications.
Versions 21 and later
Universal Windows 10 App This function is now available in Universal Windows 10 App mode.
New in version 21
Universal Windows 10 App This function is now available in Universal Windows 10 App mode.
Universal Windows 10 App This function is now available in Universal Windows 10 App mode.
Example
ResNbPixels is real = TextWidth(EDT_Edit1, "Hello")
Syntax
<Result> = TextWidth(<Control Name> , <Text> [, <Options>])
<Result>: Real
Width of the text (in pixels) in the specified control (according to the control style).
You can get the width in millimeters by using the following formula:
<Nb pixels> = <Screen resolution>*<Nb millimeters>/25.4
Android Note: The width will be null for the unsupported controls. Only the edit controls and the Static controls are supported.
<Control Name>: Character string (with or without quotes)
Name of the edit control, Static control or Combo Box control.
Android Name of the edit control or Static control.
<Text>: Character string (with quotes)
Text whose width must be calculated.
<Options>: Optional integer constant
Configures the mode for calculating the width of the text:
tDefault
(default value)
Width of the text in the control.
tMultilineWidth of the text in the control. The maximum width will correspond to the width of the control.
tSingleLineWidth of the text while ignoring the width of the control. This constant is used to get a precision greater than the one given by the tDefault constant.
Components
WINDEVReports and Queries wd230std.dll
Windows Mobile wp230std.dll
Java wd230java.jar
Linux wd230std.so
Android wd230android.jar
Minimum required version
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment