1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Problem with List textbox

Discussion in 'C#' started by daniel1000, Sep 30, 2010.

  1. daniel1000

    daniel1000 New Member

    Sep 30, 2010
    Likes Received:
    Trophy Points:
    Hi everybody.

    I have got a textbox called "textbox1". And an object, called player[0]
    There I generated a list: public List textboxInformation = new List();

    In the main method i wrote:
    player[0].textboxInformation .Add(textbox1);

    I want to access this box, by calling the "object.textboxInformation"

    If i count "player[0].textboxInformation.Count" , i get "1" as a result.
    So it has to be stored.

    But i can´t access it by:
    MessageBox.Show(player[0].textboxInformation [0].Text);
    And I also can´t modify the text:
    spieler[0].textboxInformation [0].Text = "TEST";

    It always says, its no object...

    Does anyone know, who to access it correctly?

    Thx alot!

Share This Page