Microsoft KB Archive/299591

= BUG: Item Is Not Highlighted in a FullRowSelect ListView Control =

Article ID: 299591

Article Last Modified on 10/15/2002

-

APPLIES TO


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

-



This article was previously published under Q299591



SYMPTOMS
After you select a row in a ListView control that has the FullRowSelect property set to True, right-aligned columns that do not contain any data are not highlighted.



RESOLUTION
To resolve this problem, add data to the empty column. If you add a space character to the column, it is highlighted when selected.



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



Steps to Reproduce Behavior
 Create a new Standard EXE project in Visual Basic. Form1 is created by default. On the Project menu, select Components, select the Microsoft Windows Common Controls 6.0 library check box, and then click OK. Add a ListView control to Form1.  Add the following code to the General Declarations section of Form1: Option Explicit

Private Sub Form_Load Dim i As Integer Dim o As Object

ListView1.View = lvwReport ListView1.FullRowSelect = True

For i = 1 To 2 ListView1.ColumnHeaders.Add, , &quot;Column &quot; & i   Next i

' Set the alignment of column two to the right. ListView1.ColumnHeaders(2).Alignment = lvwColumnRight

Set o = ListView1.ListItems.Add(,, &quot;Item1&quot;) ' Place a blank space in column two of row two. Set o = ListView1.ListItems.Add(,, &quot;Item2&quot;) o.ListSubItems.Add, , &quot; &quot; End Sub  Press the F5 key to run the program. Notice that when you select row one in the ListView control, column two is not highlighted. However, when you select row two, column two is highlighted because it contains a space.</ol>

Additional query words: field listitem

Keywords: kbbug kblistview kbcmnctrls kbctrl kbpending KB299591

-

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

© Microsoft Corporation. All rights reserved.