BUG: Behavior of Lightweight WLVScroll Is Different from VScrollBar
Article ID: 206897
Article Last Modified on 10/15/2002
APPLIES TO
- Microsoft Visual Basic 6.0 Professional Edition
- Microsoft Visual Basic 6.0 Enterprise Edition
This article was previously published under Q206897
SYMPTOMS
The behavior of the lightweight vertical scrollbar is different from the intrinsic scrollbar. This difference is accentuated when the scrollbar is set to a small maximum value. The lightweight scrollbar always rounds down the position of the slider to the next lower value. The intrinsic scrollbar rounds the slider position either up or down to the nearest position as a function of its proximity. This difference is likely to be noticed, especially if developers are going to be using sliders as an input device to allow users to select from a discrete, small number of options.
RESOLUTION
The lightweight scrollbar can be made to behave like the intrinsic vertical scrollbar by scaling it. The following procedure outlines the procedure.
Step-By-Step Instructions
- Start a Standard EXE project in Visual Basic. Form1 is added by default.
- On the Project menu, select Components, check Microsoft Windowless Controls 6.0, and then click OK.
- Place an intrinsic VScrollBar and a WLVScroll control on Form1.
- Set the Max value on the WLVScroll control to 100 and set the Max value on the VScrollBar to 1.
- Set the LargeChange property on the WLVScroll to 100. This makes the WLVScroll look identical to the ScrollBar.
- Add the following code to the Change event of the WLVScroll:
Private Sub WLVScroll1_Change
If WLVScroll1.Value > 70 Then
WLVScroll1.Value = WLVScroll1.Max
Else
WLVScroll1.Value = 0
End If
End Sub
- Run the project from the Start menu, or by pressing the F5 key.
- Drag the slider of ScrollBar downward, almost to the bottom, and release it. The slider jumps to the bottom of the scrollbar.
- Drag the slider of the WLVScroll to the same position as in the previous step. The slider jumps down to the bottom of the scrollbar. The two controls now have the identical behavior.
STATUS
Microsoft has confirmed that this is a bug in the Microsoft products that are listed at the beginning of this article.
REFERENCES
For additional information, click the article number below
to view the article in the Microsoft Knowledge Base:
184687 INFO: Lightweight controls in Visual Basic 6.0
Keywords: kbbug kbscrollbar kbctrl kbpending KB206897