A Sighting


Laure

Recommended Posts

So, I'm in a bit of a lull at work so I'm reading up on C#. (They keep telling me that we'll eventually transition away from C++, so why not get paid while updating my skills?) Anyway, here's an example code snippet I ran across:

public class Tester

{

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

for (int i = 0;i<lbt.GetNumEntries();i++)

{

Console.WriteLine("lbt[{0}]: {1}",i,lbt);

}

}

}

(from Microsoft's MSDN Magazine)

...just had to share! :)

Edited by Laure
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now