PRB: Closing a Modal Form Raises an Application Error (251292)
The information in this article applies to:
- Microsoft Visual Basic Learning Edition for Windows 6.0
- Microsoft Visual Basic Professional Edition for Windows 6.0
- Microsoft Visual Basic Enterprise Edition for Windows 6.0
This article was previously published under Q251292 SYMPTOMS
An application error occurs when a modal dialog or form is closed after being shown from the ItemClick event of a ListView control in Microsoft Visual Basic. The error only occurs if the ListView control is cleared in the ItemClick event and an item other than the first item in the ListView was clicked.
RESOLUTION
To work around this behavior, the ListView control must be disabled before it is cleared. Once the ListView is cleared, the control can then be enabled.
Private Sub ListView1_ItemClick(ByVal Item As MSComctlLib.ListItem) ListView1.Enabled = False
ListView1.ListItems.Clear
ListView1.Enabled = True
MsgBox "Cleared"
End Sub
Modification Type: | Major | Last Reviewed: | 5/12/2003 |
---|
Keywords: | kbBug kbControl kbCtrl kbListView kbnofix kbprb KB251292 |
---|
|