FIX: Scroll Bar Thumb Doesn't Do Change Event as It Should
ID: Q96798
|
The information in this article applies to:
-
Microsoft Visual Basic Standard and Professional Editions for Windows, version 2.0
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 INFORMATIONSteps 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
- Add the following code to the HScroll1_Change event procedure:
Sub HScroll1_Change ()
Label1.Caption = Str$(HScroll1.Value)
End Sub
- From the Run menu, choose Start (ALT, R, S) to run the program.
- 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.
- 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.
Additional query words:
buglist2.00 fixlist3.00 2.00 3.00
Keywords :
Version : WINDOWS:2.0
Platform : WINDOWS
Issue type :
|