using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Collections;
namespace WindowsFormsApplication1
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            ArrayList ar = new ArrayList();
            for (int i = 0; i < 10; i++)
                ar.Add(i);
            Button b = new Button();
            b.Parent = this;
            TextBox t = new TextBox();
            t.Parent = this;
            ar.Add(b);
            ar.Add(t); 
            ListBox lst = new ListBox();
            lst.Items.Add(21);
            lst.Items.Add(22);
            ar.AddRange(lst.Items);
            //for (int j = 0; j < ar.Count; j++)
            //    if (ar[j].GetType().Equals(typeof(int)))                
            //        listBox1.Items.Add(ar[j]);
            foreach (object x in ar)
                if (x.GetType().Equals(typeof(int)))
                    listBox1.Items.Add(x);                                
            
        }
    }
}
