views:

30

answers:

3

Good day, I've just started teaching myself VB.net. I'm trying to create a simple note keeping program.

I've come across a problem, where by I call the Clear method of the ListView object, and its column headers disappear.

screen shot of what happens

The code for button 2 is:

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
    lstNotes.Clear()
    End Sub

Any help will be appreciated, thanks!

A: 

Augh, as luck would have it, I got the answer Just after posting.

lstNotes.Items.Clear()

Busk
Glad you found the answer! Please mark your answer as "accepted answer" (= click on the check mark), so that the question no longer shows up as "unanswered".
Heinzi
Thats the way it often goes.
StingyJack
A: 

use Items.clear() instead!

lstNotes.Items.Clear()
Wael Dalloul
+2  A: 

The Clear method on a listview does exactly that. Just as advertised.

Use lstNotes.Items.Clear() instead.

klausbyskov
+1 for linking to documentation.
Heinzi