0

I am developing a solution in C # and I need to add a few buttons to TabbedPanel. Happens that debugger adds only one and even a single button.

 public void AddDrinkstoTabbedpanel(TabPage tp)
        {

              List<string> drinks = new List<string>();//New list empty
              food foo = new food();//Call food to get drinks
              string []product = foo.name;//string product [] = food.name (drink)
              foreach (string value in product)//(string value in product)//for any "value" in product 
              {

                  Button bt = new Button();
                  bt.Size = new Size(100, 100);
                  drinks.Add(value);

                  tp.Controls.Add(bt);

                  //listofButtons.Add(bt);

              }


        }

I previously define an array with some items and now i need to add a button for each item founded, how can I modify this code given above to get what I want.

1
  • 1
    From your code, it seems that various buttons are added, but you cannot see them because they have the same location (one on top of other).
    – user2480047
    Feb 26, 2014 at 10:48

1 Answer 1

0

Change the Location for all buttons. They are being created but at the same position and look like one.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.