Please i have a textbox, a button and a listview. The listview contains a list of items let's say 20 items. When i enter 3 in the textbox and click on the button, the first three items should be removed likewise if i enter 10, then the first 10 items should be removed. If i enter anything more than 20, the 20 items should be removed. Please help me out. Thanks in advance.

After verifying that a valid number has been entered you can do

For i = 1 To CInt(TextBox1.Text)
    ListView1.Items.RemoveAt(0)
Next
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.