Exemple #1
0
            static void Main(string[] args)
            {
                ListBoxTest lbt = new ListBoxTest("Hello", "World");

                lbt.Add("What");
                lbt.Add("Is");
                lbt.Add("The");
                lbt.Add("C");
                lbt.Add("Sharp");
                string subst = "Universe";

                lbt[1] = subst;
                // tru cap tat ca cac chuoi
                int count = 1;

                foreach (string s in lbt)
                {
                    Console.WriteLine("Value {0}: {1}", count, s);
                    count++;
                }

                foreach (string s in lbt)
                {
                    Console.WriteLine("Value {0}: {1}", count, s);
                    count++;
                }

                Console.ReadLine();
            }
Exemple #2
0
 public ListBoxEnumerator(ListBoxTest lbt)
 {
     this.lbt = lbt;
     index    = -1;
 }