Microsoft KB Archive/206897

= 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.</li> Drag the slider of ScrollBar downward, almost to the bottom, and release it. The slider jumps to the bottom of the scrollbar.</li> 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.</li></ol>

<div class="status_section">

STATUS
Microsoft has confirmed that this is a bug in the Microsoft products that are listed at the beginning of this article.

<div class="moreinformation_section">

Steps to Reproduce Behavior

 * 1) Start a Standard EXE project in Visual Basic. Form1 is added by default.
 * 2) From the Project menu, select Components, check Microsoft Windowless Controls 6.0, and then click OK.
 * 3) Place an intrinsic VScrollBar and a WLVScroll control on Form1.
 * 4) Set the Max values on both the WLVScroll and the VScrollBar to 1.
 * 5) From the Start menu, or with F5, run the project.
 * 6) Drag the slider on the intrinsic VScrollBar down to nearly, but not quite, the bottom. You should see the slider jump the rest of the way down to the bottom. This is the expected behavior.
 * 7) Drag the slider on the WLVScroll control to about the same position as in the previous step.
 * 8) Unlike the intrinsic control, the slider of the WLVScroll jumps back to the top.

<div class="references_section">