List boxes are components utilized in Web and desktop types. You can add, eliminates and edit the content controlled in the list box utilizing Visual Basic. One way of the list box control is the "Clear ()" function. This function eliminates all the substances of the list box so you can add or delete the fraction during run-time of the application. The Clear () function also makes it easier to remove all items in place of looping through each item individually and deleting them.
Instructions:
Fill your Visual Basic creation in Visual Studio. At the right side of the screen is the Solution Explorer. Double-click one of the type files to add a list box to the application.
Drag and drop novel list box from the toolbox to the type file. In the belongings window underneath Solution Explorer, edit the "Name" field. Name the list box list Test. In the "Items" field, enter "Test 1" and "Test 2." These are the first standards in the list box.
Right-click the type files and selects "View Code." This opens the code where you can clear the list box values.
Enter the subsequent code to the begin event:
listTest.Clear
Press the F5 key on the keyboard to run the application. Load the type. Notice that the items entered into the list box are cleared.



LinkBack URL
About LinkBacks
Reply With Quote