VB Form_Paint Event Occurs When Grid Refresh Method Called

ID Number: Q83765

1.00

WINDOWS

buglist1.00

Summary:

The Grid custom control supplied with Microsoft Visual Basic

Professional Toolkit will cause a Form_Paint event if you call the

Grid's Refresh method. This means that any code in the Form_Paint

procedure will be executed every time you do a Refresh on the Grid.

Microsoft has confirmed this to be a problem with the Grid custom

control supplied with Microsoft Visual Basic 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:

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

GRID.VBX custom control file. The Grid custom control appears in

the Toolbox.

3. Add a Grid control (Grid1) to Form1.

4. In the Form_Paint event, add the following code:

Sub Grid1_Click ()

Grid1.Refresh

End Sub

5. In the Form_Paint event, add the following code:

Sub Form_Paint ()

Debug.Print "In Form_Paint event"

End Sub

6. Press F5 to run the program, and click on the Grid. Notice that the

Debug.Print statement is executed in the Form_Paint event.

Additional reference words: 1.00