Microsoft KB Archive/190673

= BUG: Flat Scroll Bars in ListView Do Not Work Correctly =

Article ID: 190673

Article Last Modified on 5/13/2003

-

APPLIES TO


 * Microsoft Visual Basic 6.0 Learning Edition
 * Microsoft Visual Basic 6.0 Professional Edition
 * Microsoft Visual Basic 6.0 Enterprise Edition

-



This article was previously published under Q190673



SYMPTOMS
When using the FlatScrollBar in the ListView control you may run into one of the following problems:


 * 1) If you check the FlatScrollBar property of the ListView in the IDE, you will not see a ScrollBar when you run the form.

-or-
 * 1) The FlatScrollBar does not appear to track properly on the ListView control. The control scrolls the columns properly, but the ScrollBar "thumb" position does not match.



RESOLUTION
For problem number 1, set the FlatScrollBar property for the ListView control in the form Activate instead of the IDE.

There is no resolution for problem number 2 at this time.



STATUS
Microsoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article. We are researching this bug and will post new information here in the Microsoft Knowledge Base as it becomes available.



Steps to Reproduce Behavior
 Create a new Standard EXE project. Form1 is created by default. Using the Projects menu, select Components to bring up the Components dialog box. On the Controls Tab, select "Microsoft Windows Common Controls 6.0," and then click OK. Place a ListView and ImageList control on Form1. Add four Images to the ImageList Control using the Images Tab of the ImageList control's Property Page. In the Properties window, for the ListView control set the FlatScrollBar property to True.  Add the following code to Form1's code window: Option Explicit

Private Sub Form_Activate ' Uncomment the next line to show the scroll bar as Flat. ' For this to work you must make sure that you don't have ' FlatScrollBar set to True in the properties window of the ListView. 'ListView1.FlatScrollBar = True End Sub

Private Sub Form_Load Dim i As Integer Dim y As Integer y = 1

' Add some items to the ListView control For i = 1 To 40 ListView1.ListItems.Add Text:="test" & Str(i), Icon:=y y = y + 1 If y = 5 Then y = 1 Next i     End Sub

</li> Save and run the project. You will not have a ScrollBar on the ListView control.</li>  In the Properties window for the ListView control, set the FlatScrollBar property to False, and then uncomment the following line of code in the Form_Activate: ListView1.FlatScrollBar = True

</li> Save and run the project. You now have a flat ScrollBar on the ListView control.</li> Try using the ScrollBar to scroll to the bottom of the ListView control. You will see the control scroll past the last items in the ListView and the ScrollBar will go to the bottom. But after you release the ScrollBar it will jump towards the top of the control, but you will still see the last items in the ListView control.</li></ol>

Additional query words: kbDSupport kbDSD kbCtrl kbVBp kbVBp600bug

Keywords: kbbug KB190673

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.