Microsoft KB Archive/82875

= FIX: Graph Custom Control Legends May Print Incorrectly =

Article ID: 82875

Article Last Modified on 2/23/2007

-

APPLIES TO


 * Microsoft Visual Basic 2.0 Standard Edition
 * Microsoft Windows 2000 Readiness Analyzer

-



This article was previously published under Q82875



SYMPTOMS
The Graph custom control allows you to place a legend on a graph so that each set of numerical data has a corresponding LegendText property. If one or more of the LegendText properties is a null string, Graph may space the legend texts incorrectly or make them overlap.



WORKAROUND
To work around the problem, add a string of text other than the null string to the LegendText. If you do not want any text to appear, you can add a string of spaces.

Note that this problem is related to your computer's configuration. It can appear worse on some computers, or it may not appear at all. Occasionally, the problem can be circumvented by changing the Width and/or Height property of the graph. However, you cannot calculate the amount necessary to correct the problem, and it may not prove to be a permanent solution. For these reasons we do not suggest this method as a viable workaround.



STATUS
Microsoft has confirmed this to be a bug in the Graph custom control supplied with the products listed above. This problem was corrected in the Graph custom control shipped with Microsoft Visual Basic version 3.0 for Windows.



Steps to Reproduce Problem
 Start Visual Basic or from the File menu, choose New Project (ALT, F, N) if Visual Basic is already running. Form1 is created by default. From the File menu, choose Add File. In the Files box, select the GRAPH.VBX custom control file. The Graph tool appears in the toolbox. On Form1, add a command button (Command1) and a Graph control (Graph1).  Change the following properties:   Control    Property   Value

Command1  Caption    Create Legends Graph1    NumSets    3 Graph1    Width      3500 Graph1    Height     2100   In the Command1 Click event, add the following code: Sub Command1_Click Graph1.LegendText = &quot;legend 1&quot; Graph1.LegendText = &quot;&quot; Graph1.LegendText = &quot;legend 3&quot; Graph1.DrawMode = 2      'redraws graph to show new legend texts End Sub </li> Press F5 to run the program, and click the Command1 button.</li></ol>

When you run the program and click the Command1 button, the graph will update with the three LegendText properties. The second one is a null string and does not appear, but its corresponding colored box does. On most computers, this colored box appears lower than expected, and may be partially overlapped by the legend's third colored box. By changing the Width and/or Height property of Graph1, you can change the placement of the second colored box.

Additional query words: buglist1.00 buglist2.00 fixlist3.00 1.00 2.00 3.00

Keywords: kbbug kbfix KB82875

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.