VB Scroll Bar Value Altered in Run Mode if Max < Min

ID Number: Q80407

1.00

WINDOWS

buglist1.00

Summary:

If the Max property of a horizontal or vertical scroll bar is set less

than the Min property, the Value property will be equal to the Min

property at run-time regardless of its design time setting.

Microsoft has confirmed this to be a problem in Microsoft Visual Basic

programming system version 1.0 for Windows. We are researching this

problem and will post new information here as it becomes available.

More Information:

The problem only occurs when the:

- Max property is less than the Min property

- Value property is set at design time.

Workaround

----------

In the Form_Load event procedure, set the Value property of the scroll

bar. For example:

Sub Form1_Load

HScroll1.Value = 0

End Sub

The above code will cause the scroll bar thumb to remain in the center

of the scroll bar at run-time. The Value property of the scroll bar

will be zero when printed from the Immediate window.

Steps to Reproduce Problem

--------------------------

1. Run Visual Basic, or from the File menu, choose New Project (ALT,

F, N) if Visual Basic is already running. Form1 will be created by

default.

2. Select a horizontal scroll bar (HScroll1) from the Toolbox and

place it on Form1.

3. Set the Max property of HScroll1 to -100.

4. Set the Min property of HScroll1 to 100.

6. From the Properties Bar, select Value, and set it equal to 0 in the

Settings box.

Note: The thumb scroll will now be positioned in the middle of the

scroll bar.

7. From the Run menu, choose Start (ALT, R, S).

Note: The thumb scroll will now be positioned on the left side of

the scroll bar.

8. From the Run menu, choose Break.

9. In the Immediate window, type the following:

Print HScroll1.Value

The value returned will be 100; the value of the Min property.

Additional reference words: 1.00

#z234a