When the user clicks on the listbox, what do you expect to show them? You might consider constructing a class with the items you want to save, but define them as pointers to the various control objects. Yes, C# supports pointers, but you have to define them as "unsafe" because they are not part of the supported MSIL component. You could then show a string element stored as part of the class in the listbox and, after they make their selection, use the pointers held in the class in whatever way you deem necessary. I don't really like this approach since it is not portable, nor do I like using controls (IU elements) as data objects (i.e., buffers). Still, it might suit your purposes.
Dr. Purdum
Jack Purdum, Ph.D.
Author: Beginning C# 3.0: Introduction to Object Oriented Programming (and 14 other programming texts)
|