> class ImageData > { > internal int Width { get; private set;} > internal int Height { get; private set; } > > internal ImageData( int width, int height) > { > > Width = width; > Height = height; > } > } > > static class TestImage > { > > internal static void Go() > { > Dictionary<string, ImageData> images = new Dictionary<string,ImageData>(); > > images.Add("image1", new ImageData(10, 20)); > images.Add("image2", new ImageData(30, 40)); > > string s = "image4"; > > bool found = false; > ImageData imagedata; > > > if( images.TryGetValue(s, out imagedata) ) > found = true; > > > } > } >We've recommended use of a Dictionary over the VB specific collection before (see thread 1574508). Also, if he just needs to know if the data exists and not the actual value, ContainsKey will work as well.