TextWidth and TextHeight functions. RpvCorporate.ocx control
Use these functions to know the width or
the height (in
twips) of a text.
Syntax:
TextWidth(InputStr, FontName, FontSize, FontBold)
TextHeight(InputStr, FontName, FontSize, FontBold)
Example:
Width_in_twips = Rpv1.TextWidth("My text",
"arial", 12, 0)
Height_in_twips = Rpv1.TextHeight("My text",
"arial", 12, 0)
For the "FontBold" parameter, 0 means
normal and 1 means bold.
It is remmarkable that TextWidth
and TextHeight measure the text based on the printer. For that reason,
you could note some differences between what you see and what you get
printed. If printer is not installed or it is not reachable by the
control, the measurement will be based on the screen. However,
differences may appear when zooming in and zooming out. |
|