Hi all,

I want to create an arraylist from MDI childforms and I did it like this:

vb.net Code:
  1. Dim sl As New SortedList(Of Integer, Form)
  2.         Dim i As Integer
  3.         Dim form As Form
  4.         For Each form In Me.MdiChildren
  5.             sl.Add(CInt(form.Text), form)
  6.         Next
  7.         form = New Form
  8.         form.MdiParent = Me
  9.         If sl.Count > 0 Then
  10.             For i = 1 To Integer.MaxValue
  11.                 If sl.Keys.IndexOf(i) = -1 Then Exit For
  12.             Next
  13.             form.Text = i.ToString
  14.         Else
  15.             form.Text = "1"
  16.         End If
  17.         form.Show()

It's working great, that means that if I delete a childform for example number 2 from all 3 then it creats first number 2 again and then number 4.

Now the problem is that It only shows the childformnumber in the parentformtext instead of the name and number of that childform,like this: parentform - childform 1