FIX: Scroll Bar Thumb Doesn't Do Change Event as It Should (96798)



The information in this article applies to:

  • Microsoft Visual Basic Standard Edition for Windows 2.0
  • Microsoft Visual Basic Professional Edition for Windows 2.0

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.

MORE INFORMATION

Steps to Reproduce Problem

  1. 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.
  2. Add a horizontal scroll bar (HScroll1) to Form1.
  3. Add a label (Label1) to Form1.
  4. Add a command button (Command1) to Form1.
  5. 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
    						
  6. Add the following code to the Command1_Click event procedure:
       Sub Command1_Click ()
          HScroll1.Value = HScroll1.Max
       End Sub
    						
  7. Add the following code to the HScroll1_Change event procedure:
       Sub HScroll1_Change ()
          Label1.Caption = Str$(HScroll1.Value)
       End Sub
    						
  8. From the Run menu, choose Start (ALT, R, S) to run the program.
  9. 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.
  10. 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.

Modification Type:MajorLast Reviewed:10/30/2003
Keywords:kbbug kbfix KB96798