JM,
Can you have a look from the sample I made from your code
You need for this to set a button in top of the form, I made as well your
listview a little bit smaller and used because of that the mouse down.
\\\\
Public SubLevelCount As Integer
Public SubImgLst() As ImageList
Friend myListViews As New ArrayList
Friend myListViewCount As Integer
Private Sub Button1_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles Button1.Click
Dim SubLstView As New ListView
' SubImgLst = New ImageList
' SubImgLst.ImageSize = New Size(32, 32)
'SubImgLst.Images.Add(Console.imgLstMain.Images(1))
SubLstView.Left = 8 + myListViewCount * 60
SubLstView.Top = 32
SubLstView.Width = 56
SubLstView.Height = 24
SubLstView.Name = (myListViewCount + 1).ToString
SubLstView.BackColor = Drawing.Color.FromArgb(58, 110, 165)
SubLstView.ForeColor = System.Drawing.Color.White
SubLstView.MultiSelect = False
' SubLstView.Parent = Console
SubLstView.Sorting = SortOrder.Ascending
' SubLstView.SmallImageList = SubImgLst
' SubLstView.LargeImageList = SubImgLst
myListViews.Add(SubLstView)
AddHandler SubLstView.MouseDown, AddressOf ListView_MouseDown
Me.Controls.Add(SubLstView)
myListViews.Add(SubLstView)
myListViewCount += 1
End Sub
Private Sub ListView_MouseDown(ByVal sender As Object, _
ByVal e As System.Windows.Forms.MouseEventArgs)
If myListViews.Count > 0 Then
Dim mylastlistview As ListView = _
DirectCast(myListViews(myListViews.Count - 1), ListView)
myListViews.RemoveAt(myListViews.Count - 1)
Me.Controls.Remove(mylastlistview)
myListViewCount -= 1
End If
End Sub
///
What is does is creating a listview when the button is clicked and removes
the last when there is a mouse down on whatever listview.
Is it alreayd 2005 there in NZ?
Than Happy newsyear
I hope this helps?
Cor