Hi,
I have this problem, when I run application I see listbox with items "red", "blue", "yellow". But when I type "black" to textBox1 and press Button1 item is not added. Any idea why?
public partial class Window1 : Window
{
private static ArrayList myItems = new ArrayList();
public Window1()
{
InitializeComponent();
}
private void Window_Loaded(object sender, RoutedEventArgs e)
{
listBox1.ItemsSource = myItems;
myItems.Add("red");
myItems.Add("blue");
myItems.Add("yellow");
}
private void button1_Click(object sender, RoutedEventArgs e)
{
myItems.Add(textBox1.Text);
}
}