PRB: Leading Spaces Trimmed in DataReport Label Multi-Line Caption (248459)
The information in this article applies to:
- Microsoft Visual Basic Professional Edition for Windows 6.0
- Microsoft Visual Basic Enterprise Edition for Windows 6.0
This article was previously published under Q248459 SYMPTOMS
When the CanGrow property of a DataReport's label is set to True, the label automatically grows vertically if the text in the Caption property exceeds the preset size of the control. However, when assigning a multi-line string that contains leading spaces to the Caption property, the leading spaces are trimmed from all lines except the first line. The trimming also occurs even if character 32 (a blank space) is concatenated into the string.
RESOLUTION
If you are building the string dynamically in code, one workaround is to use character 160 rather than blank spaces or character 32. The following code creates a two-line string with five leading spaces in the first line and ten leading spaces in the second line:
Dim mystr as String
mystr = " Five Leading Spaces" & vbCrLf
mystr = mystr & String(10, 160) & "Ten Leading Spaces"
NOTE: This workaround assumes that you are using the standard ANSI character set. In the ANSI character set, character 160 is a blank space while in other character sets it represents an actual letter or symbol.
Modification Type: | Major | Last Reviewed: | 1/11/2001 |
---|
Keywords: | kbDesigner kbDSupport kbprb KB248459 |
---|
|