ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WLanguage / WLanguage functions / Controls, pages and windows / Control functions
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
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.
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
<Control name>: Character string
Name of the Edit control, Static control or Combo Box control.
<Text>: Character string
Text whose width must be calculated.
<Options>: Optional integer constant
Configures the mode for calculating the width of the text:
tWithMarginAllows you to take into account the margins set for the control (left indentation, right indentation, etc.).
This constant can be combined with the tMultiline constant.
Java This constant is not available.
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.
Business / UI classification: UI Code
Component: wd290std.dll
Minimum version required
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 05/26/2022

Send a report | Local help