ItemData property does not exist for ListBox and ComboBox controls (311340)
The information in this article applies to:
- Microsoft Visual Basic .NET (2002)
- Microsoft Visual Basic 2005
- Microsoft Visual Basic .NET (2003)
This article was previously published under Q311340 SYMPTOMS You may notice the following symptoms:
- When you upgrade a Microsoft Visual Basic 6.0 project to
Visual Basic .NET or Visual Basic 2005, the data that is listed in the Properties window for the ItemData property is discarded.
- In Visual Basic 6.0, you can set the ItemData property for a ListBox or a ComboBox control at design time through the Properties window. In Visual
Basic .NET or in Visual Basic 2005, the ItemData property no longer exists for these controls.
RESOLUTION To resolve this problem, use one of the following methods:
- If you upgraded a project from Visual Basic 6.0 to Visual
Basic .NET or Visual Basic 2005, use the VB6.SetItemData method (from the Visual Basic 6.0 compatibility library) to fill
the list. This method is usually called in the constructor of the form (the Public Sub New procedure).
- For a new Visual Basic .NET or Visual Basic 2005 project, use a class to hold
the list items. For more information, refer to the "More Information"
section.
STATUSThis
behavior is by design.REFERENCES For more information about how to upgrade the ItemData property from Visual Basic 6.0 to Visual Basic .NET or Visual Basic 2005, refer to the
"ItemData property cannot be upgraded" topic in the Visual Studio .NET or Visual Basic 2005 Online
Help documentation.
To better understand the differences between a
class and a structure, refer to the "Structures and Classes" topic in the
Visual Studio .NET or Visual Basic 2005 Online Help documentation.
Note The example companies, organizations, products, domain names,
e-mail addresses, logos, people, places, and events depicted herein are
fictitious. No association with any real company, organization, product, domain
name, email address, logo, person, places, or events is intended or should be
inferred.
Modification Type: | Minor | Last Reviewed: | 10/3/2006 |
---|
Keywords: | kbvs2005swept kbvs2005applies kbmigrate kbprb kbUpgrade KB311340 kbAudDeveloper |
---|
|