How to Use the ListView Control in Visual Basic
The ListView control has enhancements over the standard ListBox control that is found in Visual Basic. You can add icons and text and arrange the items into columns with or without column headings. Entries can be organized into four views: large icons, small icons, list and report. Here's how to use the ListView control in Visual Basic.
Instructions
-
-
1
Click on "Start" in the lower left-hand corner of the desktop screen. Then select "All Programs, Microsoft Visual Studio 6.0 and Visual Basic 6.0."
-
2
Select "Standard EXE" from the list in the New Project dialog box, then click on "Open." Choose "Project" on the menu bar, then select "Components" from the drop-down menu.
-
-
3
Scroll down the list in the listbox until Microsoft Windows Common Controls 6.0 (SP4) is visible. Click on the checkbox to select the component and then click on "OK."
-
4
Choose the "ListView" control from the list of controls in the toolbox. Place the control on the form in Visual Basic.
-
5
Perform a right mouse click on the control on the form and select properties. The Property Pages dialog box will open and allow navigation through the General, Image Lists, Sorting, Column Headers, Color, Font and Picture tabs at the top of the dialog box and set the properties as desired for the control.
-
1
Tips & Warnings
The coding for the ListView control can be tricky at times. Pay attention to all of the properties that can be set for items when they are added to the control and plan accordingly.