VB Graph Custom Control Legends May Print Incorrectly

ID Number: Q82875

1.00

WINDOWS

buglist1.00

Summary:

The Graph 1.2 custom control from Microsoft Professional Toolkit for

Visual Basic 1.0 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.

Microsoft has confirmed this to be a problem with the Graph version

1.2 custom control supplied with Microsoft Professional Toolkit for

Microsoft Visual Basic programming system version 1.0 for Windows. We

are researching this problem and will post new information here as it

becomes available.

More Information:

Workaround

----------

A workaround is to 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: This problem is related to your system's configuration. It can

appear worse on some machines than others, 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.

The following example displays the behavior described above.

Steps to Reproduce Problem

--------------------------

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 appears in the

toolbox.

3. On Form1, add a command button (Command1) and a Graph control

(Graph1).

4. Change the following properties:

Control Property Value

------- -------- -----

Command1 Caption Create Legends

Graph1 NumSets 3

Graph1 Width 3500

Graph1 Height 2100

4. In the Command1 Click event, add the following code:

Sub Command1_Click ()

Graph1.LegendText = "legend 1"

Graph1.LegendText = ""

Graph1.LegendText = "legend 3"

Graph1.DrawMode = 2 'redraws graph to show new legend texts

End Sub

5. Press F5 to run the program, and click on the Command1 button.

When you run the program and click on 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 machines, 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 reference words: 1.00