Esempio n. 1
0
      static void Main()
      {
         // create a new ListBox and initialize
         ListBoxTest lbt = new ListBoxTest( "Hello", "World" );

         // add a few strings
         lbt.Add( "Proust" );
         lbt.Add( "Faulkner" );
         lbt.Add( "Mann" );
         lbt.Add( "Hugo" );

         // test the access
         string subst = "Universe";
         lbt[1] = subst;

         // access all the strings
         for ( int i = 0; i < lbt.GetNumEntries(); i++ )
         {
            Console.WriteLine( "lbt[{0}]: {1}", i, lbt[i] );
         }
      }
Esempio n. 2
0
        static void Main()
        {
            // create a new ListBox and initialize
            ListBoxTest lbt = new ListBoxTest("Hello", "World");

            // add a few strings
            lbt.Add("Proust");
            lbt.Add("Faulkner");
            lbt.Add("Mann");
            lbt.Add("Hugo");

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

            lbt[1] = subst;

            // access all the strings
            for (int i = 0; i < lbt.GetNumEntries(); i++)
            {
                Console.WriteLine("lbt[{0}]: {1}", i, lbt[i]);
            }
        }