Article ID: 175547
Article Last Modified on 12/10/2003
APPLIES TO
- Microsoft Visual Basic 4.0 Professional Edition
- Microsoft Visual Basic 5.0 Professional Edition
- Microsoft Visual Basic 4.0 Enterprise Edition
- Microsoft Visual Basic 5.0 Enterprise Edition
This article was previously published under Q175547
SYMPTOMS
Continually changing the Image properties of buttons on a Toolbar control results in an increased refreshed rate.
STATUS
Microsoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article. This bug has been corrected in Visual Studio 97 Service Pack 2.
MORE INFORMATION
Steps to Reproduce Issue
- Start a new Standard EXE project in Visual Basic. Form1 is created by default.
- Set a Reference to the "Microsoft Windows Common Controls" component.
- Add one CommandButton, one Toolbar, and one ImageList to Form1.
- Add two images to the ImageList control by completing the following steps:
- Click the Custom property of the ImageList control. The Property Pages dialog box appears.
- Click the Images tab.
- Click the Insert Picture button. The Select picture dialog box appears.
- Select two bitmap or icon files and click Open.
- Click OK to close the dialog box.
- Complete the following steps for the toolbar control:
- Click Custom property. The Property Pages dialog box appears.
- From the General Tab, set the ImageList property to ImageList1.
- From the Buttons Tab, click Insert Button to insert a button in the toolbar. Set the Image property to 1.
- Click OK to close the Property Pages dialog box.
Copy the following code to the Code window of the Form1 form.
Option Explicit Private Sub Command1_Click() Dim z As Integer, y As Integer For z = 1 To 100 y = y + 1 Toolbar1.Buttons(1).Image = y Mod 2 + 1 DoEvents Next z End Sub
- Press the F5 key to run the program. Note that the amount of time required to refresh the toolbar control increases with each iteration.
(c) Microsoft Corporation 1997, All Rights Reserved. Contributions by Arsenio Locsin, Microsoft Corporation
Additional query words: kbDSupport
Keywords: kbbug kbfix KB175547