Clearing a list box is an action often associated with computer programming and specifically programming involving the Visual Basic programming language. Visual Basic was developed by Microsoft in the 1990s. It is a relatively easy programming language to learn, and is popular with beginning computer programmers. Clearing a listbox using Visual Basic is easy, and requires only minor knowledge of the language. There may be slight differences in the applications of this task due to changes in the language with the 1998 Visual Basic Net update. Be sure you know which version of Visual Basic was used to create the listbox as this will tell you what command you need to use in order to clear it.
Determine if the list box was created using Visual Basic or Visual Basic Net. If you do not know which version created the list box, then you will have to play around with commands until you find the correct one.
Open the Visual Basic software and locate the list box you want to clear.
Type "ListBox1.Items.Clear()" into the insert code box in Visual Basic Net. If you are using the regular version of Visual Basic, type "ListBox1.Clear" into the insert code box.
Save the application you are creating and restart the Visual Basic software. The listbox should now be clear.
Tips & Warnings
- Make sure you know which version of Visual Basic you are using as this will affect how codes will work.
- Photo Credit Creatas Images/Creatas/Getty Images
How to Use a Listbox Control in MFC Visual C++
A list box is a Windows control that can display text or iconic items as a list of rows. The Microsoft Foundation...
How to Use Scrollbar With Listbox in Visual Basic 6.0
The ListBox control used in Visual Basic does not include Scrollbars as applicable properties as do other controls. When the lines of...
How to Clear a DropDownList
The DropDownList control is available in .NET for both web sites and Windows applications. A drop down list looks like a text...
ListBox Visual Basic Tutorial
The ListBox control in Visual Basic is a powerful tool for displaying lists of data and allowing the user to select one...