How to Edit a ListView Object in Visual Basic
The "ListView" object in Visual Basic (VB) lets you list several options and display the options to the user. You use the "update" function to update the items shown in the ListView and to add items to the list. After you complete the update of the items, the ListView control refreshes and the new choices display on the Windows form.
Instructions
-
-
1
Click the Windows "Start" button, and select "All Programs." Click "Microsoft .NET Framework," and click "Visual Studio" to open the Visual Basic development platform.
-
2
Double-click your VB project file in the list of projects. After the project loads, right-click the VB form that contains the ListView object and select "View Code" to load the code in your editor.
-
-
3
Type the following code to initialize the update of the ListView items:
ListView1.BeginUpdate()
-
4
Update the items in the ListView object. For example, the following code adds an item to the list:
ListView1.Items.Add("New Item");
-
5
Turn off the update status. After you add all the items you want to the ListView object, type the following code to shut off the update state and refresh the ListView object:
ListView1.EndUpdate()
ListView1.Refresh()
-
1