Microsoft KB Archive/175547

= FIX: Toolbar Performance Degrades with Dynamic Modification =

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.



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.</li> Click the Insert Picture button. The Select picture dialog box appears.</li> Select two bitmap or icon files and click Open.</li> Click OK to close the dialog box.</li></ol> </li> Complete the following steps for the toolbar control:

<ol> Click Custom property. The Property Pages dialog box appears.</li> From the General Tab, set the ImageList property to ImageList1.</li> From the Buttons Tab, click Insert Button to insert a button in the toolbar. Set the Image property to 1.</li> Click OK to close the Property Pages dialog box.</li></ol> </li>  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 </li> Press the F5 key to run the program. Note that the amount of time required to refresh the toolbar control increases with each iteration.</li></ol>

(c) Microsoft Corporation 1997, All Rights Reserved. Contributions by Arsenio Locsin, Microsoft Corporation

Additional query words: kbDSupport

Keywords: kbbug kbfix KB175547

-

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

© Microsoft Corporation. All rights reserved.