VB Graph Control Displays Maximum of 80 Characters Per Title

Last reviewed: June 21, 1995
Article ID: Q81450
The information in this article applies to:

- Professional Edition of Microsoft Visual Basic for Windows,

  versions 2.0 and 3.0
- Microsoft Professional Toolkit for Microsoft Visual Basic programming
  system for Windows, version 1.0

SUMMARY

The Graph custom control has 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.

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 for Windows, or from the File menu, choose New Project (press ALT, F, N) if Visual Basic for Windows 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 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 2.00 3.00
KBCategory: kbprg
KBSubcategory: PrgCtrlsCus


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: June 21, 1995
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.