8,757
社区成员
发帖
与我相关
我的任务
分享using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
using System.Collections;
namespace comboboxDEMO
{
/// <summary>
/// Window2.xaml 的交互逻辑
/// </summary>
public partial class Window2 : Window
{
ArrayList myAL;
public Window2()
{
InitializeComponent();
myAL = new ArrayList();
myAL.Add("Hello");
myAL.Add("World");
myAL.Add("!");
comboBox1.ItemsSource = myAL;
myAL.Add("2");
myAL.Add("3");
myAL.Add("4");
listBox1.ItemsSource = myAL;
}
private void button1_Click(object sender, RoutedEventArgs e)
{
myAL.Add("5");
myAL.Add("6");
myAL.Add("7");
}
private void button2_Click(object sender, RoutedEventArgs e)
{
myAL.Add("15");
myAL.Add("16");
myAL.Add("17");
}
}
}
