Explore BrainMass

Remove an item from combo box based on first letter in Visual Basic

"In the following exercises, assume that the Simple combo box appears as shown and that the Sorted property is set to True. Give a statement or statements that will carry out the stated task."

The combo box contains:

1. Delete the name Goethe.
2. Insert the name Cervantes.
3. Delete every item beginning with the letter M. The code should do the job even if additional items were added to the list.

Here is what I did for 1 and 2:
1) cboBox.Items.Remove("Goethe")
2) cboBox.Items.Add("Cervantes")

How do I delete an item based on its first letter?

Solution Summary

This solution provides guidelines on how to carry out different tasks in computer programming (deleting items and entries).