What i Am Trying to do is Add Items into listbox1 and when i specific item is selected it shows more info in another list box
So Here an Example:
Listbox1 Has a Person Bob When Bob is Selected His Phone Number Shows up on Listbox2
You Can Also Add a Phone Number to the Selected Item. When another Item is Selected Bob Phone Number Disappears and shows the Next Selected Name and Phone
So in My Case When a Organisation is Selected it shows all the names of the people that work in that Organisation
Here is what i have (Not Sure if it is right or wrong NEW to c#)
Person.cs
string FirstName;
string PhoneNumber;
public Person(string FName, string PNumber)
{
FirstName = FName;
PhoneNumber = PNumber;
}
Organisation.cs
string Name;
public string OrggName
{
get
{
return Name;
}
set
{
Name = value;
}
}
public override string ToString()
{
return Name;
}
Button Click Event
private void button1_Click(object sender, EventArgs e)
{
NewOrgg = new Organisation();
NewOrgg.OrggName = textBox1.Text;
listBox1.Items.Add(NewOrgg);
}