dim s() as string For Each fm1 In Panel1.Controls dim i=0 if fm1.GetType.ToString = "System.Windows.Forms.TextBox" Then s(i)=fm1.text i+=1 End If Next