-
September 30th, 2010, 12:19 PM
#1
Problem with List textbox
Hi everybody.
I have got a textbox called "textbox1". And an object, called player[0]
There I generated a list: public List<TextBox> textboxInformation = new List<TextBox>();
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!
-
September 30th, 2010, 12:21 PM
#2
Re: Problem with List textbox
Originally Posted by daniel1000
Hi everybody.
I have got a textbox called "textbox1". And an object, called player[0]
There I generated a list: public List<TextBox> textboxInformation = new List<TextBox>();
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!
*spieler = player
I tranlated it from german And forgot one
-
September 30th, 2010, 12:29 PM
#3
Re: Problem with List textbox
public partial class Spielfeld : Form
{
spielerClass[] spieler = new spielerClass[3];
public Spielfeld()
{
spieler[0] = new spielerClass();
spieler[0].text.Add(S0kartenGesamtWertA);
MessageBox.Show(Convert.ToString(spieler[0].einsatzAuswahl[0].Value));
}
...
}
- - - - - -
class spielerClass
{
public List<NumericUpDown> einsatzAuswahl = new List<NumericUpDown>();
...
}
Thats the original code. Oh and its no textbox, it´s numericUpAnDown
-
September 30th, 2010, 10:14 PM
#4
Re: Problem with List textbox
What are you trying to do exactly? What's your game plan?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|