3
Answers

C# add Textbox to List

ilhami caliskan

ilhami caliskan

11y
5.4k
1

 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)