Microsoft KB Archive/96798

= FIX: Scroll Bar Thumb Doesn't Do Change Event as It Should =

Article ID: 96798

Article Last Modified on 10/30/2003

-

APPLIES TO


 * Microsoft Visual Basic 2.0 Standard Edition
 * Microsoft Visual Basic 2.0 Professional Edition

-



This article was previously published under Q96798



SYMPTOMS
A Change event is generated when Visual Basic code sets a scroll bar's Value property. However, if the user then drags the thumb (scroll box) on the scroll bar to either its minimum or maximum value, a change event should occur but may not. The change event is generated correctly when the thumb on the scroll bar is dragged to any point other then its minimum or maximum after Visual Basic code sets the Value property.



STATUS
Microsoft has confirmed this to be a bug in the Standard and Professional Editions of Microsoft Visual Basic version 2.0 for Windows. This problem was corrected in 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. Add a horizontal scroll bar (HScroll1) to Form1. Add a label (Label1) to Form1. Add a command button (Command1) to Form1.  Add the following code to Form1's Form_Load event procedure: Sub Form_Load Form1.Show HScroll1.Value = 1 HScroll1.Min = 1 HScroll1.Max = 100 End Sub   Add the following code to the Command1_Click event procedure: Sub Command1_Click HScroll1.Value = HScroll1.Max End Sub </li>  Add the following code to the HScroll1_Change event procedure: Sub HScroll1_Change Label1.Caption = Str$(HScroll1.Value) End Sub </li> From the Run menu, choose Start (ALT, R, S) to run the program.</li> Choose the command button. The thumb on the scroll bar correctly moves to its maximum position and the label displays the Max property of HScroll1, 100.</li> Drag and drop the thumb on the scroll bar back to its minimum position. The label incorrectly continues to display the Max property for HScroll1, 100. A change event should have occurred in HScroll1 when the thumb was dragged back to its minimum position, and the caption should have changed to 1. But the change event was not generated.</li></ol>

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

Keywords: kbbug kbfix KB96798

-

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

© Microsoft Corporation. All rights reserved.