VB Graph Control Displays Maximum of 80 Characters Per Title

ID Number: Q81450

1.00

WINDOWS

Summary:

In the Graph custom control supplied with Microsoft Professional

Toolkit, there is an 80 character maximum limit on all displayed

strings such as labels and legends. However, the combined length of

the actual string may be longer than 80 characters.

This information applies to the Microsoft Professional Toolkit for

Microsoft Visual Basic programming system version 1.0 for Windows.

More Information:

The Graph custom control can display strings by using several

different properties. For example, the BottomTitle and LeftTitle

properties may be set from the Properties bar in the programming

environment.

The following example sets the BottomTitle property of a Graph to 90

characters:

1. Run Visual Basic, or from the File menu, choose New Project (ALT,

F, N) if Visual Basic is already running. Form1 is created by

default.

2. From the File menu, choose Add File. In the Files box, select the

GRAPH.VBX custom control file. The Graph tool will appear in the

toolbox.

3. Select the Graph icon on the toolbox and place it on Form1,

and expand it to the largest size possible.

4. Double-click on the Graph control to open the Code window for the

Click event.

5. Add the following code to the Click event:

Graph1.BottomTitle = String$(79, "i") + "*"

Debug.Print Len(Graph1.BottomTitle)

Graph1.DrawMode = 2 'Update Graph

6. Run the program and click on the graph control. If your Graph is

expanded to the largest possible size, you should be able to see

the string of 80 characters.

7. Change the code as follows:

Graph1.BottomTitle = String$(80, "i") + "*"

Debug.Print Len(Graph1.BottomTitle)

Graph1.DrawMode = 2 'Update Graph

You should not be able to see the last character, the asterisk (*).

In this example, 80 characters at most will show on the screen even

though you set the BottomTitle property to a larger character string.

The actual BottomTitle property, however, contains more characters.

Whether or not the actual strings are displayed also depends on

other factors, such as the width and height of the control, or the

strings that are placed in the other properties of the control.

Additional reference words: 1.00