FIX: Cannot Programmatically Select Items in ListView (143427)
The information in this article applies to:
- Microsoft Visual Basic Standard Edition, 32-bit, for Windows 4.0
- Microsoft Visual Basic Professional Edition, 32-bit, for Windows 4.0
- Microsoft Visual Basic Enterprise Edition, 32-bit, for Windows 4.0
This article was previously published under Q143427 SYMPTOMS
After setting the Selected property of a ListItem in the ListView control
to True, the SelectedItem property returns the last item that was selected
with a mouse click.
RESOLUTION
The code below can be used as a workaround instead of Selected = True.
Sub SelectAListItem(iItemToSelect%)
Dim Item As ListItem
Set Item = ListView1.ListItems(iItemToSelect%)
Set ListView1.SelectedItem = Item
End Sub
STATUS
Microsoft has confirmed this to be a bug in the Microsoft products listed
at the beginning of this article. This bug has been fixed in Visual Basic
5.0.
Modification Type: | Major | Last Reviewed: | 11/18/2003 |
---|
Keywords: | kbbug kbfix KB143427 |
---|
|