G
Guest
//I had a class
public class PERSON
{
PERSON(string LName, string FName, string age)
{
m_last = LName;
m_first = FName;
m_age = age;
}
public string LastName
{
get {return m_last;}
set {m_last = value;}
}
public string FirstName
{
get {return m_first;}
set {m_first = value;}
}
public string PersonAge
{
get {return m_age;}
set {m_age = value;}
}
string m_last;
string m_first;
string age;
}
//In Form1 I do this:
ArrayList CollectionList = new ArrayList();
for(int i = 0; i < Person.Length; i++)
{
CollectionList.Add( new PERSON(LastN, FirstN, PAge));
}
foreach (PERSON per in CollectionList)
{
this.LastcomboBox.Text = per.LastName.ToString();
this.FirstcomboBox.Text = per.FirstName.ToString();
}
//My question is: if I had a list of LastName and FirstName display in a
ComBoBox. How do I display Age in TextBox? when user pick the person
LastName it also show that person age in a TextBox?
Any help are appreciated,
public class PERSON
{
PERSON(string LName, string FName, string age)
{
m_last = LName;
m_first = FName;
m_age = age;
}
public string LastName
{
get {return m_last;}
set {m_last = value;}
}
public string FirstName
{
get {return m_first;}
set {m_first = value;}
}
public string PersonAge
{
get {return m_age;}
set {m_age = value;}
}
string m_last;
string m_first;
string age;
}
//In Form1 I do this:
ArrayList CollectionList = new ArrayList();
for(int i = 0; i < Person.Length; i++)
{
CollectionList.Add( new PERSON(LastN, FirstN, PAge));
}
foreach (PERSON per in CollectionList)
{
this.LastcomboBox.Text = per.LastName.ToString();
this.FirstcomboBox.Text = per.FirstName.ToString();
}
//My question is: if I had a list of LastName and FirstName display in a
ComBoBox. How do I display Age in TextBox? when user pick the person
LastName it also show that person age in a TextBox?
Any help are appreciated,