ilhami caliskan

ilhami caliskan

  • NA
  • 76
  • 91.7k

C# add Textbox to List

Aug 10 2013 1:30 AM

 Hi All,
Anybody who can tell me why I cant add textbox to List?

         private List<String> inputList = new List<String>();


        public void AddInputBox(String data,String inputTxt)
        {            
            this.inputDataList.Add(data);

            
            TextBox txtBx = new TextBox();           
            txtBx.Height = 20;
            txtBx.Width = 50;
            txtBx.ReadOnly = true;


            int number = this.inputList.Count;
            txtBx.Location = new Point(number * 55, 20);
            txtBx.Text = inputTxt;

            //Add txtBox to inputList
            this.inputList.Add(txtBx); ----> here I get error "some invalide arguments"

            this.Controls.Add(txtBx);

Thanx to All


Answers (3)