BUG: ListView SubItemIndex Property Not ConvertedLast reviewed: March 5, 1998Article ID: Q182068 |
The information in this article applies to:
SYMPTOMSYou convert a project written in Visual Basic 4.0 to Visual Basic 5.0. When you run the project, you note that the SubItemIndex property of a column header in a ListView control has a value of 0 (zero), or you receive the following error:
Run-time Error '380': Invalid Property Value CAUSEThe SubItemIndex property is omitted from the form file (.FRM) after Visual Basic version 5.0 converts a 4.0 form containing a ListView control. This results in the SubItemIndex property having a value of 0.
RESOLUTIONOpen the form file (.FRM) in Notepad and add the missing SubItemIndex value. See the MORE INFORMATION section for a step-by step-example.
STATUSMicrosoft 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.
MORE INFORMATION
Steps to Reproduce Behavior
WorkaroundClose the project in Visual Basic. Backup the Form1.frm file, and then open the Form1.frm file using Notepad and add the missing SubItemIndex value as follows. Before editing, the column 2 header information in Form1.frm will resemble the following:
BeginProperty ColumnHeader(2) {0713E8C7-850A-101B-AFC0-4210102A8DA7} Key = "Address" Object.Tag = "" Text = "Address" Object.Width = 2540 EndPropertyAfter adding the SubItemIndex line (use spaces to indent), it should resemble:
BeginProperty ColumnHeader(2) {0713E8C7-850A-101B-AFC0-4210102A8DA7} SubItemIndex = 1 Key = "Address" Object.Tag = "" Text = "Address" Object.Width = 2540 EndPropertyNOTE: If there were more than 2 columns, you would do the same for any additional column headers. For example, Column 3 would have a SubItemIndex = 2.
|
Additional query words: conversion
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |