Example #1
0
        static void Main()
        {
            ListBoxTest lbt = new ListBoxTest("Hello", "World");

            lbt.Add("Who");
            lbt.Add("Is");
            lbt.Add("John");
            lbt.Add("Galt");

            string subst = "Universe";

            lbt[1] = subst;

            foreach (string s in lbt)
            {
                Console.WriteLine("Value: {0}", s);
            }
        }
Example #2
0
        static void Main(string[] args)
        {
            //pravi novi popis i inicijalizira ga
            ListBoxTest lbt = new ListBoxTest("Hello", "World");

            //dodaje nekoliko nizova
            lbt.Add("Who");
            lbt.Add("Is");
            lbt.Add("John");
            lbt.Add("Galt");

            //testira pristup
            string subst = "Universe";

            lbt[1] = subst;

            //pristupa svim nizovima
            foreach (string s in lbt)
            {
                Console.WriteLine("Value: {0}", s);
            }
        }
        static void Main()
        {
            // create a new list box and initialize
            ListBoxTest lbt =
                new ListBoxTest("Hello", "World");

            // add a few strings
            lbt.Add("Who");
            lbt.Add("Is");
            lbt.Add("John");
            lbt.Add("Galt");

            // test the access
            string subst = "Universe";

            lbt[1] = subst;

            // access all the strings
            foreach (string s in lbt)
            {
                Console.WriteLine("Value: {0}", s);
            }
        }